modules: partially apply .nix suffix check
hasSuffix runs some checks on the suffix, that can be done all at once rather than every single time.
This commit is contained in:
committed by
Robert Helgesson
parent
cbfe673271
commit
3b0e6bbd65
+2
-3
@@ -16,6 +16,7 @@
|
||||
}:
|
||||
|
||||
let
|
||||
hasNixSuffix = lib.hasSuffix ".nix";
|
||||
|
||||
modules = builtins.concatLists [
|
||||
[
|
||||
@@ -86,9 +87,7 @@ let
|
||||
(
|
||||
dir:
|
||||
lib.pipe (builtins.readDir dir) [
|
||||
(lib.filterAttrs (
|
||||
_path: kind: kind == "directory" || (kind == "regular" && lib.hasSuffix ".nix" _path)
|
||||
))
|
||||
(lib.filterAttrs (path: kind: kind == "directory" || (kind == "regular" && hasNixSuffix path)))
|
||||
(lib.mapAttrsToList (path: _kind: lib.path.append dir path))
|
||||
]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user