diff options
-rw-r--r-- | custom/dotfiles.nix | 8 | ||||
-rw-r--r-- | vali.nix | 7 |
2 files changed, 11 insertions, 4 deletions
diff --git a/custom/dotfiles.nix b/custom/dotfiles.nix index 3c438e27..08952c39 100644 --- a/custom/dotfiles.nix +++ b/custom/dotfiles.nix | |||
@@ -1,6 +1,7 @@ | |||
1 | { fetchgit | 1 | { fetchgit |
2 | , lib | 2 | , lib |
3 | , findutils | 3 | , findutils |
4 | , coreutils | ||
4 | }: | 5 | }: |
5 | 6 | ||
6 | let | 7 | let |
@@ -11,11 +12,12 @@ let | |||
11 | sha256 = "62a16cb79b0491b49fcfb3c03904cf8f83bf03aeeb1bff285a66bb15efd3a4e1"; | 12 | sha256 = "62a16cb79b0491b49fcfb3c03904cf8f83bf03aeeb1bff285a66bb15efd3a4e1"; |
12 | }); | 13 | }); |
13 | setupUser = name : { | 14 | setupUser = name : { |
14 | inherit name; | 15 | name = name.dir; |
15 | value = '' | 16 | value = '' |
16 | cd ${dotfiles} | 17 | cd ${dotfiles} |
17 | ${findutils}/bin/find . -type d -print0 | ${findutils}/bin/xargs -0 -I '{}' -- mkdir -p "${name}/{}" | 18 | ${findutils}/bin/find . -type d -print0 | ${findutils}/bin/xargs -0 -I '{}' -- ${coreutils}/install -o ${name.owner} -g ${name.group} -d "${name.dir}/{}" |
18 | ${findutils}/bin/find . -type f -print0 | ${findutils}/bin/xargs -0 -I '{}' -- ln -s -f "${dotfiles}/{}" "${name}/{}" | 19 | ${findutils}/bin/find . -type f -print0 | ${findutils}/bin/xargs -0 -I '{}' -- ln -s -f "${dotfiles}/{}" "${name.dir}/{}" |
20 | ${findutils}/bin/find . -type f -print0 | ${findutils}/bin/xargs -0 -I '{}' -- chown "${name.owner}:${name.group}" "${name.dir}/{}" | ||
19 | ''; | 21 | ''; |
20 | }; | 22 | }; |
21 | in | 23 | in |
@@ -75,7 +75,12 @@ rec { | |||
75 | 75 | ||
76 | system.activationScripts = let | 76 | system.activationScripts = let |
77 | setupUsers = pkgs.callPackage custom/dotfiles.nix {}; | 77 | setupUsers = pkgs.callPackage custom/dotfiles.nix {}; |
78 | in setupUsers [ "/home/gkleen" ]; | 78 | toRec = name : { |
79 | dir = "/home/${name}"; | ||
80 | owner = name; | ||
81 | group = "users"; | ||
82 | }; | ||
83 | in setupUsers (builtins.map toRec [ "gkleen" ]); | ||
79 | 84 | ||
80 | services.xserver = { | 85 | services.xserver = { |
81 | windowManager.xmonad = { | 86 | windowManager.xmonad = { |