From 4445bddfb210a29eced70c5225b11d682b0e7e9f Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 3 Jul 2015 21:30:14 +0200 Subject: seperated dotfiles --- custom/dotfiles.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 custom/dotfiles.nix (limited to 'custom/dotfiles.nix') 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 @@ +{ 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); -- cgit v1.2.3