diff options
Diffstat (limited to 'custom')
-rw-r--r-- | custom/dotfiles.nix | 8 |
1 files changed, 5 insertions, 3 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 |