modules: allow root level nix files

More flexibility in allowing root level files to import, for those that
don't need nesting.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman
2025-06-23 10:56:02 -05:00
parent f5098b0740
commit bda9deb791

View File

@@ -77,9 +77,11 @@ let
++ (lib.concatMap
(
dir:
lib.pipe dir [
builtins.readDir
(lib.filterAttrs (_path: kind: kind == "directory"))
lib.pipe (builtins.readDir dir) [
(lib.filterAttrs (path: _kind: !lib.hasPrefix "_" path))
(lib.filterAttrs (
_path: kind: kind == "directory" || (kind == "regular" && lib.hasSuffix ".nix" _path)
))
(lib.mapAttrsToList (path: _kind: lib.path.append dir path))
]
)