summaryrefslogtreecommitdiff
path: root/custom/dotfiles.nix
blob: b4ccab62925476bb411113d358389299c844814d (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 = "377401ceefea6772915071267625cd02c066f86e";
    sha256 = "258e15ff69afaa663541b1691e1385d43b74d086891e4a0009d3507ab6cfbbe8";
  });
  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);