blob: e45fc2d0d93b7b39ff226019f0bfff2b7563157f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
{ fetchgit
, lib
, findutils
}:
let
dotfiles = fetchgit (rec {
name = "dotfiles-${rev}";
url = git://git.yggdrasil.li/dotfiles;
rev = "377401ceefea6772915071267625cd02c066f86e";
sha256 = "258e15ff69afaa663541b1691e1385d43b74d086891e4a0009d3507ab6cfbbe8";
});
setupUser = name : {
inherit name;
value = ''
cd ${dotfiles}
${findutils}/bin/find . -type d -print0 | ${findutils}/bin/xargs -0 -I '{}' -- mkdir -p "/home/${name}/{}"
${findutils}/bin/find . -type f -print0 | ${findutils}/bin/xargs -0 -I '{}' -- ln -s -f "${dotfiles}/{}" "/home/${name}/{}"
'';
};
in
names : lib.listToAttrs (builtins.map setupUser names);
|