wolumonde: refactor module importing

This commit is contained in:
dusk 2022-08-14 06:17:15 +03:00
parent a8616a0a93
commit 5c66afb75e
Signed by: dusk
GPG Key ID: 1D8F8FAF2294D6EA
9 changed files with 5 additions and 14 deletions

View File

@ -56,7 +56,7 @@
} }
) )
allPkgs; allPkgs;
in rec { in {
nixosConfigurations = import ./hosts {inherit lib tlib inputs;}; nixosConfigurations = import ./hosts {inherit lib tlib inputs;};
packages = lib.mapAttrs (_: pkgs: pkgs._exported) allPkgs; packages = lib.mapAttrs (_: pkgs: pkgs._exported) allPkgs;

View File

@ -6,20 +6,11 @@
... ...
}: { }: {
imports = let imports = let
files = b = builtins;
lib.filterAttrs modules = toString ./modules;
(name: type: type == "regular" && name != "default.nix") files = b.readDir modules;
(builtins.readDir (toString ./.));
filesToImport = filesToImport =
builtins.map b.map (name: "${modules}/${name}") (b.attrNames files);
(
name:
builtins.path {
inherit name;
path = "${toString ./.}/${name}";
}
)
(builtins.attrNames files);
in in
filesToImport; filesToImport;