From a654c536fc08bc22aeea98457a273bfc38863c51 Mon Sep 17 00:00:00 2001 From: Eman Resu Date: Mon, 20 Jul 2026 09:22:13 -0400 Subject: [PATCH] lib/filesystem: partially apply hasSuffix and removeSuffix --- lib/filesystem.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/filesystem.nix b/lib/filesystem.nix index 9f05c05eb7cd..47ca72543ca6 100644 --- a/lib/filesystem.nix +++ b/lib/filesystem.nix @@ -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 {