{ fetchgit , lib , findutils , coreutils }: let dotfiles = fetchgit (rec { name = "dotfiles-${rev}"; url = git://git.yggdrasil.li/dotfiles; rev = "fa64309ec277ada0c36925fabcc18ca77f21e4cc"; sha256 = "e836b13508e5744ef94f9b772fe36a664406ba9ca622e560c72fe49c478f1865"; }); setupUser = name : { name = name.dir; value = '' cd ${dotfiles} ${findutils}/bin/find . -type d -print0 | ${findutils}/bin/xargs -0 -I '{}' -- ${coreutils}/bin/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 -h "${name.owner}:${name.group}" "${name.dir}/{}" ''; }; in names : lib.listToAttrs (builtins.map setupUser names)