summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2015-07-03 22:40:14 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2015-07-03 22:40:43 +0200
commita7465538b064358e5e11674ddc8ba8e6531e5f3a (patch)
treebf1aea5cd66a36d9cec4883e1865f5a62eb4973b
parent361318fe8f743071ccc1949d0ab51d576f5b9b6c (diff)
downloadnixos-a7465538b064358e5e11674ddc8ba8e6531e5f3a.tar
nixos-a7465538b064358e5e11674ddc8ba8e6531e5f3a.tar.gz
nixos-a7465538b064358e5e11674ddc8ba8e6531e5f3a.tar.bz2
nixos-a7465538b064358e5e11674ddc8ba8e6531e5f3a.tar.xz
nixos-a7465538b064358e5e11674ddc8ba8e6531e5f3a.zip
cooler dotfiles
-rw-r--r--custom/dotfiles.nix8
-rw-r--r--vali.nix7
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
6let 7let
@@ -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 };
21in 23in
diff --git a/vali.nix b/vali.nix
index fe88f401..b1a866ff 100644
--- a/vali.nix
+++ b/vali.nix
@@ -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 = {