Skip to content

Build your personal knowledge base with Trilium Notes

chore(nix): adapt to pnpm 11

Elian Doran51284c54610e
diff --git a/flake.lock b/flake.lock
index 54a6c2d1a9..c7a51a51fa 100644
--- a/flake.lock
+++ b/flake.lock
@@ -20,11 +20,11 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1774171785,
- "narHash": "sha256-upDSNdH1WEL2Z0ISvRXTWk7rEndTxUcaTOLY9imJYa8=",
+ "lastModified": 1779201759,
+ "narHash": "sha256-cako3/kPRtMVWkbAJsQHW4MF5Rr8antZXHR4VAO8DHg=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "f8a13215c766347f3da9beef4cfc952eb23fa46e",
+ "rev": "fee0aaa25f0714c7c9281d11054c007a21fd3637",
"type": "github"
},
"original": {
diff --git a/flake.nix b/flake.nix
index 411c4db016..4a539386c5 100644
--- a/flake.nix
+++ b/flake.nix
@@ -30,9 +30,9 @@
# This patch deduplicates entries in PATH, which results in an equivalent but shorter entry.
# https://github.com/pnpm/pnpm/issues/6106
# https://github.com/pnpm/pnpm/issues/8552
- pnpm = (pkgs.pnpm_10.overrideAttrs (prev: {
+ pnpm = (pkgs.pnpm_11.overrideAttrs (prev: {
postInstall = prev.postInstall + ''
- patch $out/libexec/pnpm/dist/pnpm.cjs ${./patches/pnpm-PATH-reduction.patch}
+ patch $out/libexec/pnpm/dist/pnpm.mjs ${./patches/pnpm-PATH-reduction.patch}
'';
}));
inherit (pkgs)
diff --git a/patches/pnpm-PATH-reduction.patch b/patches/pnpm-PATH-reduction.patch
index 8c02352168..887831d0ac 100644
--- a/patches/pnpm-PATH-reduction.patch
+++ b/patches/pnpm-PATH-reduction.patch
@@ -1,17 +1,13 @@
---- a/libexec/pnpm/dist/pnpm.cjs 2025-09-15 11:33:34.014095372 +0200
-+++ b/libexec/pnpm/dist/pnpm.cjs 2025-09-15 11:37:00.260553326 +0200
-@@ -68067,10 +68067,14 @@
- return false;
- }
- function spawn(cmd, args, options, log) {
- const cmdWillOutput = willCmdOutput(options && options.stdio);
- if (cmdWillOutput) startRunning(log);
-+ const stupidPath = options.env["PATH"];
-+ const parts = stupidPath.split(":");
-+ const partsDedup = new Set(parts);
-+ options.env["PATH"] = [...partsDedup].join(":");
- const raw = _spawn(cmd, args, options);
- const cooked = new EventEmitter();
- raw.on("error", function(er) {
- if (cmdWillOutput) stopRunning(log);
- er.file = cmd;
+--- a/libexec/pnpm/dist/pnpm.mjs 2025-09-15 11:33:34.014095372 +0200
++++ b/libexec/pnpm/dist/pnpm.mjs 2025-09-15 11:37:00.260553326 +0200
+@@ -52505,6 +52505,10 @@
+ function spawn2(cmd, args, options, log3) {
+ const cmdWillOutput = willCmdOutput(options && options.stdio);
+ if (cmdWillOutput) startRunning(log3);
++ const stupidPath = options.env["PATH"];
++ const parts = stupidPath.split(":");
++ const partsDedup = new Set(parts);
++ options.env["PATH"] = [...partsDedup].join(":");
+ const raw = _spawn(cmd, args, options);
+ const cooked = new EventEmitter2();
+ raw.on("error", function(er) {