diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2015-07-03 21:25:42 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2015-07-03 21:25:42 +0200 |
commit | 7a24d878e5299a1afddce22fb722a11eb6d16179 (patch) | |
tree | 90bd6fafd9cddca8400e47527c97f27a8c8f4f45 /vali.nix | |
parent | 33ae8e24d17fac4c385cefcdc0ae063c2a1767ee (diff) | |
download | nixos-7a24d878e5299a1afddce22fb722a11eb6d16179.tar nixos-7a24d878e5299a1afddce22fb722a11eb6d16179.tar.gz nixos-7a24d878e5299a1afddce22fb722a11eb6d16179.tar.bz2 nixos-7a24d878e5299a1afddce22fb722a11eb6d16179.tar.xz nixos-7a24d878e5299a1afddce22fb722a11eb6d16179.zip |
First attempt at dotfiles
Diffstat (limited to 'vali.nix')
-rw-r--r-- | vali.nix | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | { config, pkgs, ... }: | 5 | { config, pkgs, ... }: |
6 | 6 | ||
7 | { | 7 | rec { |
8 | imports = | 8 | imports = |
9 | [ # Include the results of the hardware scan. | 9 | [ # Include the results of the hardware scan. |
10 | ./vali-hw.nix | 10 | ./vali-hw.nix |
@@ -72,4 +72,22 @@ | |||
72 | inherit (template) shell; | 72 | inherit (template) shell; |
73 | openssh.authorizedKeys.keyFiles = template.openssh.authorizedKeys.keyFiles; | 73 | openssh.authorizedKeys.keyFiles = template.openssh.authorizedKeys.keyFiles; |
74 | }; | 74 | }; |
75 | |||
76 | system.activationScripts = let | ||
77 | dotfiles = fetchgit { | ||
78 | inherit name; | ||
79 | url = git://git.yggdrasil.li/dotfiles; | ||
80 | rev = "377401ceefea6772915071267625cd02c066f86e"; | ||
81 | sha256 = "258e15ff69afaa663541b1691e1385d43b74d086891e4a0009d3507ab6cfbbe8"; | ||
82 | }; | ||
83 | setupUsers = names : pkgs.lib.listToAttrs (builtins.map setupUser names); | ||
84 | setupUser = name : { | ||
85 | inherit name; | ||
86 | value = '' | ||
87 | cd ${dotfiles} | ||
88 | ${pkgs.findutils}/bin/find . -type d -print0 | ${pkgs.findutils}/bin/xargs -0 -I '{}' -- mkdir -p "/home/${name}/{}" | ||
89 | ${pkgs.findutils}/bin/find . -type f -print0 | ${pkgs.findutils}/bin/xargs -0 -I '{}' -- ln -s -f "${dotfiles}/{}" "/home/${name}/{}" | ||
90 | ''; | ||
91 | }; | ||
92 | in setupUsers [ "gkleen" ]; | ||
75 | } | 93 | } |