mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-16 10:05:13 -05:00
refactor: cleaned up nixos and home dirs
This commit is contained in:
parent
e596e1c1b3
commit
6854e39f7e
53 changed files with 325 additions and 292 deletions
23
modules/helpers.nix
Normal file
23
modules/helpers.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
directoryImport =
|
||||
let
|
||||
collectDirs =
|
||||
path:
|
||||
let
|
||||
content = builtins.readDir path;
|
||||
subdirs = builtins.filter (name: content.${name} == "directory") (builtins.attrNames content);
|
||||
buildPath = name: path + "/${name}";
|
||||
|
||||
thisDirs = map buildPath subdirs;
|
||||
subDirs = builtins.concatMap collectDirs thisDirs;
|
||||
in
|
||||
[ path ] ++ subDirs;
|
||||
in
|
||||
path:
|
||||
builtins.listToAttrs (
|
||||
map (dir: {
|
||||
name = baseNameOf (toString dir);
|
||||
value = import dir;
|
||||
}) (collectDirs path)
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue