nodejs: cleanup

Move allowed names to higher scope and partially apply hasPrefix.
This commit is contained in:
Eman Resu
2026-07-20 10:29:40 -04:00
parent d55c01c37d
commit d0f1b06287
+26 -25
View File
@@ -3,6 +3,31 @@
nodejs-slim,
symlinkJoin,
}:
let
hasDisallowedPrefix = lib.hasPrefix "__";
allowedNames = [
"override"
"overrideAttrs"
"overrideDerivation"
"outputs"
"outputName"
"system"
"type"
# Filter out arguments of `getOutput`
"bin"
"dev"
"include"
"lib"
"man"
"out"
"static"
# Filter out outputs that didn't exist on 25.11
"npm"
"corepack"
];
in
(symlinkJoin {
pname = "nodejs";
inherit (nodejs-slim) version passthru meta;
@@ -22,31 +47,7 @@
})
(
builtins.filter (
name:
!lib.strings.hasPrefix "__" name
&& !(builtins.elem name [
"override"
"overrideAttrs"
"overrideDerivation"
"outputs"
"outputName"
"system"
"type"
# Filter out arguments of `getOutput`
"bin"
"dev"
"include"
"lib"
"man"
"out"
"static"
# Filter out outputs that didn't exist on 25.11
"npm"
"corepack"
])
&& !(builtins.hasAttr name nodejs)
name: !hasDisallowedPrefix name && !(builtins.elem name allowedNames) && !(nodejs ? ${name})
) (builtins.attrNames nodejs-slim)
)
))