summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vali.nix20
1 files changed, 19 insertions, 1 deletions
diff --git a/vali.nix b/vali.nix
index b23912b1..f96e156f 100644
--- a/vali.nix
+++ b/vali.nix
@@ -4,7 +4,7 @@
4 4
5{ config, pkgs, ... }: 5{ config, pkgs, ... }:
6 6
7{ 7rec {
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}