diff --git a/modules/core/default.nix b/modules/core/default.nix index e69de29..09a4da8 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -0,0 +1,19 @@ +{ lib, ... }: +let + b = builtins; + + module_files = + b.readDir ./. |> + lib.filterAttrs (name: type: + ( (lib.strings.hasSuffix ".nix" name + && name != "default.nix" + && type == "regular" ) + || ( type == "directory" + && b.pathExists ./${name}/default.nix)) + ) |> + b.attrNames |> + b.map (f: ./${f}); +in +{ + imports = module_files; +} \ No newline at end of file