n8n: 2.31.6 → 2.32.6, drop obsolete xlsx lockfile workaround, harden update.sh

n8n 2.32 replaced the sheetjs-CDN xlsx@0.20.2 tarball (which lacked an
integrity checksum and had to be patched into pnpm-lock.yaml) with the
regular npm package @e965/xlsx@0.20.3, which already carries an integrity
field. The patchXlsxLockfile workaround is therefore obsolete and actively
harmful: substituteInPlace --replace-fail no longer matches, making
fetchPnpmDeps fail with a build error (not a hash mismatch), which left the
fake-hash sentinel behind in n8n.nix on update.

- overlays/mods/n8n.nix: remove xlsx workaround; bump to 2.32.6 with real
  src (sha256-wWm6...) and pnpmDeps (sha256-QzUJCF+...) hashes.
- tests/n8n-overlay-test.nix: update expectations to 2.32.6; drop the
  obsolete checkXlsxIntegrityPatch.
- overlays/mods/update.sh: use a literal SRI sentinel instead of lib.fakeHash
  (lib is not in scope inside the {prev}: overlay); add a snapshot-based EXIT
  trap that restores n8n.nix on any failure (error/SIGINT/SIGTERM/killed
  build) while preserving pre-existing working-tree edits; surface a clearer
  message when fetchPnpmDeps fails for a non-hash reason.
This commit is contained in:
m3tam3re
2026-07-30 08:09:36 +02:00
parent ab7f14dac6
commit 8d9b0cf742
3 changed files with 76 additions and 78 deletions
+8 -14
View File
@@ -1,33 +1,27 @@
{prev}: let
xlsxTarball = "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz";
xlsxIntegrity = "sha512-+nKZ39+nvK7Qq6i0PvWWRA4j/EkfWOtkP/YhMtupm+lJIiHxUrgTr1CcKv1nBk1rHtkRRQ3O2+Ih/q/sA+FXZA==";
patchXlsxLockfile = ''
substituteInPlace pnpm-lock.yaml \
--replace-fail \
"resolution: {tarball: ${xlsxTarball}}" \
"resolution: {integrity: ${xlsxIntegrity}, tarball: ${xlsxTarball}}"
'';
# n8n >= 2.32 replaced the sheetjs-CDN `xlsx@0.20.2` tarball (which lacked an
# integrity checksum and had to be patched into pnpm-lock.yaml) with the
# regular npm package `@e965/xlsx@0.20.3`, which already carries an integrity
# field. The old lockfile-integrity workaround is therefore obsolete and has
# been removed.
in
prev.n8n.overrideAttrs (finalAttrs: previousAttrs: {
version = "2.31.6";
version = "2.32.6";
src = prev.fetchFromGitHub {
owner = "n8n-io";
repo = "n8n";
tag = "n8n@${finalAttrs.version}";
hash = "sha256-OTVfIHnGTaBogEd93Ak2Pu3Jh7VweQNYbUeahq1Z/64=";
hash = "sha256-wWm6vGyJ2I2SBU38gRGaZG2FR5FBxH6V/sWQwn5B4Ac=";
};
pnpmDeps = prev.fetchPnpmDeps {
inherit (finalAttrs) pname version src;
pnpm = prev.pnpm_10;
fetcherVersion = 3;
prePnpmInstall = patchXlsxLockfile;
hash = "sha256-Q3HCJg1KjdRJnPZJEUKcaCrh8tBhT9B3gqMz8xbBZVg=";
hash = "sha256-QzUJCF+VIku9/HrmiUR9FNCU3MlYtyKOILZjFNXvN8U=";
};
prePnpmInstall = (previousAttrs.prePnpmInstall or "") + patchXlsxLockfile;
preBuild =
(previousAttrs.preBuild or "")
+ ''