From a7465538b064358e5e11674ddc8ba8e6531e5f3a Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 3 Jul 2015 22:40:14 +0200 Subject: cooler dotfiles --- custom/dotfiles.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'custom') 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 @@ { fetchgit , lib , findutils +, coreutils }: let @@ -11,11 +12,12 @@ let sha256 = "62a16cb79b0491b49fcfb3c03904cf8f83bf03aeeb1bff285a66bb15efd3a4e1"; }); setupUser = name : { - inherit name; + name = name.dir; value = '' cd ${dotfiles} - ${findutils}/bin/find . -type d -print0 | ${findutils}/bin/xargs -0 -I '{}' -- mkdir -p "${name}/{}" - ${findutils}/bin/find . -type f -print0 | ${findutils}/bin/xargs -0 -I '{}' -- ln -s -f "${dotfiles}/{}" "${name}/{}" + ${findutils}/bin/find . -type d -print0 | ${findutils}/bin/xargs -0 -I '{}' -- ${coreutils}/install -o ${name.owner} -g ${name.group} -d "${name.dir}/{}" + ${findutils}/bin/find . -type f -print0 | ${findutils}/bin/xargs -0 -I '{}' -- ln -s -f "${dotfiles}/{}" "${name.dir}/{}" + ${findutils}/bin/find . -type f -print0 | ${findutils}/bin/xargs -0 -I '{}' -- chown "${name.owner}:${name.group}" "${name.dir}/{}" ''; }; in -- cgit v1.2.3