2026-07-10 13:22:27 +02:00
|
|
|
{prev}: let
|
2026-07-30 08:09:36 +02:00
|
|
|
# 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.
|
2026-09-04 08:04:34 +02:00
|
|
|
#
|
|
|
|
|
# n8n >= 2.37.0 demands pnpm >= 11.22.0 via `engines.pnpm`, but the pinned
|
|
|
|
|
# nixpkgs only ships pnpm_10 (10.34.5) and pnpm_11 (11.17.0) — both too old.
|
|
|
|
|
# pnpm enforces that gate for ITSELF regardless of `engine-strict`, so both
|
|
|
|
|
# fetchPnpmDeps and the main build die with ERR_PNPM_UNSUPPORTED_ENGINE
|
|
|
|
|
# before any hash mismatch is even reached. Additionally n8n's lockfile,
|
|
|
|
|
# while still declaring lockfileVersion '9.0', now serialises
|
|
|
|
|
# patchedDependencies as plain `name@version: hash` scalars (no `path:`
|
|
|
|
|
# mapping), which pnpm 10 cannot parse (ERR_PNPM_LOCKFILE_CONFIG_MISMATCH).
|
|
|
|
|
# We therefore build with pnpm_11 + fetcherVersion 4 and relax the engine
|
|
|
|
|
# gate in package.json. Drop the sed once nixpkgs ships pnpm >= 11.22 and
|
|
|
|
|
# this overlay's nixpkgs pin has caught up.
|
|
|
|
|
relaxPnpmEngine = ''
|
|
|
|
|
sed -i -E 's/"pnpm": *"[^"]*"/"pnpm": "*"/' package.json
|
|
|
|
|
'';
|
2026-07-10 13:22:27 +02:00
|
|
|
in
|
|
|
|
|
prev.n8n.overrideAttrs (finalAttrs: previousAttrs: {
|
2026-09-11 17:31:48 +02:00
|
|
|
version = "2.38.7";
|
2026-07-04 09:30:16 +02:00
|
|
|
|
2026-07-10 13:22:27 +02:00
|
|
|
src = prev.fetchFromGitHub {
|
|
|
|
|
owner = "n8n-io";
|
|
|
|
|
repo = "n8n";
|
|
|
|
|
tag = "n8n@${finalAttrs.version}";
|
2026-09-11 17:31:48 +02:00
|
|
|
hash = "sha256-APKju7+jHw2fET+1FDFi8EhAQ3ZJRVzy8LwPgLm3Bbc=";
|
2026-07-04 09:30:16 +02:00
|
|
|
};
|
2026-07-10 13:22:27 +02:00
|
|
|
|
|
|
|
|
pnpmDeps = prev.fetchPnpmDeps {
|
|
|
|
|
inherit (finalAttrs) pname version src;
|
2026-09-04 08:04:34 +02:00
|
|
|
pnpm = prev.pnpm_11;
|
|
|
|
|
fetcherVersion = 4;
|
|
|
|
|
postPatch = relaxPnpmEngine;
|
2026-09-11 17:31:48 +02:00
|
|
|
hash = "sha256-0k3h5dcVPzLpZoYstJkFrXrcP4kmB0A2Q0YdAdmfOGs=";
|
2026-07-10 13:22:27 +02:00
|
|
|
};
|
|
|
|
|
|
2026-09-04 08:04:34 +02:00
|
|
|
postPatch = (previousAttrs.postPatch or "") + relaxPnpmEngine;
|
|
|
|
|
|
|
|
|
|
# Swap pnpm_10 -> pnpm_11 from the inherited nativeBuildInputs: upstream
|
|
|
|
|
# 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
|
|
|
|
|
# is — it discovers the fetcher version from pnpmDeps' .fetcher-version.
|
|
|
|
|
nativeBuildInputs = builtins.map (x:
|
|
|
|
|
if (x.outPath or null) == prev.pnpm_10.outPath
|
|
|
|
|
then prev.pnpm_11
|
|
|
|
|
else x)
|
|
|
|
|
previousAttrs.nativeBuildInputs;
|
|
|
|
|
|
2026-07-10 13:22:27 +02:00
|
|
|
preBuild =
|
|
|
|
|
(previousAttrs.preBuild or "")
|
|
|
|
|
+ ''
|
|
|
|
|
if [ ! -e node_modules/sass-embedded ] && [ -e node_modules/.pnpm/node_modules/sass-embedded ]; then
|
|
|
|
|
ln -s .pnpm/node_modules/sass-embedded node_modules/sass-embedded
|
|
|
|
|
fi
|
|
|
|
|
if [ ! -e node_modules/sqlite3 ] && [ -e node_modules/.pnpm/node_modules/sqlite3 ]; then
|
|
|
|
|
ln -s .pnpm/node_modules/sqlite3 node_modules/sqlite3
|
|
|
|
|
fi
|
|
|
|
|
'';
|
|
|
|
|
|
2026-07-26 12:09:22 +02:00
|
|
|
# Self-contained update script (./update.sh) — fetches latest stable
|
|
|
|
|
# release from n8n-io/n8n, recomputes both src and pnpmDeps hashes.
|
|
|
|
|
# The CI workflow in .gitea/workflows/nix-update.yml discovers and runs it.
|
|
|
|
|
passthru = (previousAttrs.passthru or {}) // {updateScript = ./update.sh;};
|
|
|
|
|
|
2026-07-10 13:22:27 +02:00
|
|
|
meta =
|
|
|
|
|
previousAttrs.meta
|
|
|
|
|
// {
|
|
|
|
|
changelog = "https://github.com/n8n-io/n8n/releases/tag/n8n@${finalAttrs.version}";
|
|
|
|
|
};
|
|
|
|
|
})
|