diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2015-07-03 21:30:14 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2015-07-03 21:30:14 +0200 |
commit | 4445bddfb210a29eced70c5225b11d682b0e7e9f (patch) | |
tree | 2757e404b42e18325ee8fc79eb9eda1f64acc607 /custom | |
parent | f5c9e1edf27a9bb5b08cdb00b54df9a0ac282e47 (diff) | |
download | nixos-4445bddfb210a29eced70c5225b11d682b0e7e9f.tar nixos-4445bddfb210a29eced70c5225b11d682b0e7e9f.tar.gz nixos-4445bddfb210a29eced70c5225b11d682b0e7e9f.tar.bz2 nixos-4445bddfb210a29eced70c5225b11d682b0e7e9f.tar.xz nixos-4445bddfb210a29eced70c5225b11d682b0e7e9f.zip |
seperated dotfiles
Diffstat (limited to 'custom')
-rw-r--r-- | custom/dotfiles.nix | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/custom/dotfiles.nix b/custom/dotfiles.nix new file mode 100644 index 00000000..e45fc2d0 --- /dev/null +++ b/custom/dotfiles.nix | |||
@@ -0,0 +1,22 @@ | |||
1 | { fetchgit | ||
2 | , lib | ||
3 | , findutils | ||
4 | }: | ||
5 | |||
6 | let | ||
7 | dotfiles = fetchgit (rec { | ||
8 | name = "dotfiles-${rev}"; | ||
9 | url = git://git.yggdrasil.li/dotfiles; | ||
10 | rev = "377401ceefea6772915071267625cd02c066f86e"; | ||
11 | sha256 = "258e15ff69afaa663541b1691e1385d43b74d086891e4a0009d3507ab6cfbbe8"; | ||
12 | }); | ||
13 | setupUser = name : { | ||
14 | inherit name; | ||
15 | value = '' | ||
16 | cd ${dotfiles} | ||
17 | ${findutils}/bin/find . -type d -print0 | ${findutils}/bin/xargs -0 -I '{}' -- mkdir -p "/home/${name}/{}" | ||
18 | ${findutils}/bin/find . -type f -print0 | ${findutils}/bin/xargs -0 -I '{}' -- ln -s -f "${dotfiles}/{}" "/home/${name}/{}" | ||
19 | ''; | ||
20 | }; | ||
21 | in | ||
22 | names : lib.listToAttrs (builtins.map setupUser names); | ||