home: wip refact for modular home-manager
This commit is contained in:
parent
55d59132eb
commit
4ef4631356
9 changed files with 622 additions and 460 deletions
30
modules/home-manager/dotfiles.nix
Normal file
30
modules/home-manager/dotfiles.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
home.file =
|
||||
let
|
||||
listFilesRecursive =
|
||||
dir: acc:
|
||||
lib.flatten (
|
||||
lib.mapAttrsToList (
|
||||
k: v: if v == "regular" then "${acc}${k}" else listFilesRecursive dir "${acc}${k}/"
|
||||
) (builtins.readDir "${dir}/${acc}")
|
||||
);
|
||||
|
||||
toHomeFiles =
|
||||
dir:
|
||||
builtins.listToAttrs (
|
||||
map (x: {
|
||||
name = "./.config/${x}";
|
||||
value = {
|
||||
source = "${dir}/${x}";
|
||||
force = true;
|
||||
recursive = true;
|
||||
};
|
||||
}) (listFilesRecursive dir "")
|
||||
);
|
||||
in
|
||||
toHomeFiles ../../dotfiles;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue