fix(n8n): match pnpm by pname/version, not outPath

Comparing x.outPath == prev.pnpm_10.outPath forces the pnpm_10
derivation. On nixpkgs pins where pnpm_10 is insecure-marked
(nixos-26.05 ships 10.34.0 with 9 CVEs) that comparison alone throws
"Refusing to evaluate" — even though the package is only discarded
by the swap. Match on pname + major version instead: plain attrs,
nothing forced, identical swap semantics on the m3ta pin.
This commit is contained in:
m3ta-chiron committed 2026-10-14 15:06:25 +02:00
1 parent 9a2927c2e0
commit cbd7d982ef
1 file changed
+6 -1
+6 -1
View File
@@ -44,8 +44,13 @@ in
# n8n calls pnpm directly during the build (install/build/prune) and pnpm 10 # n8n calls pnpm directly during the build (install/build/prune) and pnpm 10
# cannot parse the pnpm-11 lockfile. The top-level pnpmConfigHook stays as # cannot parse the pnpm-11 lockfile. The top-level pnpmConfigHook stays as
# is — it discovers the fetcher version from pnpmDeps' .fetcher-version. # is — it discovers the fetcher version from pnpmDeps' .fetcher-version.
# Match by pname/version, never by outPath: forcing prev.pnpm_10.outPath
# instantiates that derivation, and on nixpkgs pins where pnpm_10 is
# insecure-marked (e.g. nixos-26.05's pnpm 10.34.0) the comparison itself
# throws "Refusing to evaluate" — even though the package is only being
# discarded here. pname/version are plain attrs and force nothing.
nativeBuildInputs = builtins.map (x: nativeBuildInputs = builtins.map (x:
if (x.outPath or null) == prev.pnpm_10.outPath if (x.pname or null) == "pnpm" && prev.lib.versionOlder (x.version or "11") "11"
then prev.pnpm_11 then prev.pnpm_11
else x) else x)
previousAttrs.nativeBuildInputs; previousAttrs.nativeBuildInputs;