summaryrefslogtreecommitdiff
path: root/custom/dotfiles.nix
blob: 360ec7ae8d0ce5d707e693eae908d4039cf99bf4 (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 = "667427f51439c1b78ad0be188e8e2e73f0c6af90";
    sha256 = "d49627c86b9967cdea1165f9d7074e5dfc2df2004f4ee3954c1699d721ac8379";
  });
  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)