summaryrefslogtreecommitdiff
path: root/custom/dotfiles.nix
blob: aeb11f400d818e304836f0a6d7d4d05500d19fe0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{ fetchgit
, lib
, findutils
}:

let
  dotfiles = fetchgit (rec {
    name = "dotfiles-${rev}";
    url = git://git.yggdrasil.li/dotfiles;
    rev = "765d3ea5026d912f4f2679fb061279a9a3a4f88e";
    sha256 = "004d895f89721014430dc537639cd6613cbb6c335119453fc77400e7cf1c3c4b";
  });
  setupUser = name : {
    inherit name;
    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}/{}"
    '';
  };
in
  names : lib.listToAttrs (builtins.map setupUser names)