-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodule.nix
44 lines (40 loc) · 900 Bytes
/
module.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{
config,
lib,
pkgs,
...
}:
let
cfg = config.homini;
in
{
options.homini = {
enable = lib.mkEnableOption ''Enable homini.'';
dir = lib.mkOption {
type = lib.types.path;
description = ''
The path of the dotfiles directory that will be symlinked to $HOME.
'';
};
activationPackage = lib.mkOption {
internal = true;
type = lib.types.package;
description = ''
The package containing the complete activation script.
'';
};
};
config = {
homini.activationPackage =
let
activation-script = pkgs.callPackage ./activation.nix { };
in
pkgs.runCommand "homini" { } ''
mkdir -p $out/bin
cp ${activation-script} $out/bin/homini
substituteInPlace $out/bin/homini \
--subst-var-by OUT $out
ln -s ${cfg.dir} $out/homini-dotfiles
'';
};
}