lib/filesystem: partially apply hasSuffix and removeSuffix

This commit is contained in:
Eman Resu
2026-07-20 10:29:41 -04:00
parent d0f1b06287
commit a654c536fc
+4 -2
View File
@@ -375,6 +375,8 @@ in
recurseIntoAttrs
removeSuffix
;
isNixFile = hasSuffix ".nix";
removeNixSuffix = removeSuffix ".nix";
# Generate an attrset corresponding to a given directory.
# This function is outside `packagesFromDirectoryRecursive`'s lambda expression,
@@ -397,10 +399,10 @@ in
}
);
}
else if type == "regular" && hasSuffix ".nix" name then
else if type == "regular" && isNixFile name then
{
# call .nix files
"${removeSuffix ".nix" name}" = callPackage path { };
"${removeNixSuffix name}" = callPackage path { };
}
else if type == "regular" then
{