wolumonde: refactor module importing
This commit is contained in:
parent
a8616a0a93
commit
5c66afb75e
@ -56,7 +56,7 @@
|
||||
}
|
||||
)
|
||||
allPkgs;
|
||||
in rec {
|
||||
in {
|
||||
nixosConfigurations = import ./hosts {inherit lib tlib inputs;};
|
||||
|
||||
packages = lib.mapAttrs (_: pkgs: pkgs._exported) allPkgs;
|
||||
|
@ -6,20 +6,11 @@
|
||||
...
|
||||
}: {
|
||||
imports = let
|
||||
files =
|
||||
lib.filterAttrs
|
||||
(name: type: type == "regular" && name != "default.nix")
|
||||
(builtins.readDir (toString ./.));
|
||||
b = builtins;
|
||||
modules = toString ./modules;
|
||||
files = b.readDir modules;
|
||||
filesToImport =
|
||||
builtins.map
|
||||
(
|
||||
name:
|
||||
builtins.path {
|
||||
inherit name;
|
||||
path = "${toString ./.}/${name}";
|
||||
}
|
||||
)
|
||||
(builtins.attrNames files);
|
||||
b.map (name: "${modules}/${name}") (b.attrNames files);
|
||||
in
|
||||
filesToImport;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user