lib/filesystem: partially apply hasSuffix and removeSuffix
This commit is contained in:
+4
-2
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user