pnpm-fixup-state-db: make it depend on nodejs-slim

(cherry picked from commit 3f318e99f1)
This commit is contained in:
Antoine du Hamel 2026-06-07 16:24:50 +02:00 committed by Gutyina Gergő
commit 762761c420
No known key found for this signature in database
2 changed files with 5 additions and 16 deletions

View file

@ -54,19 +54,7 @@ in
pnpm-fixup-state-db' =
if pnpm.nodejs-slim or null != null then
pnpm-fixup-state-db.override {
# FIXME: make npm-config-hook accept nodejs-slim
nodejs =
let
inherit (pnpm) nodejs-slim;
in
if nodejs-slim ? paths && builtins.isList nodejs-slim.paths then
# If nodejs-slim has a list `paths` attribute, it's likely a simlinkJoin
nodejs-slim
else
# Otherwise we need to recreate one by overriding the default one
pnpm-fixup-state-db.nodejs.override {
inherit nodejs-slim;
};
inherit (pnpm) nodejs-slim;
}
else
pnpm-fixup-state-db;

View file

@ -1,7 +1,7 @@
{
buildNpmPackage,
lib,
nodejs,
nodejs-slim,
pnpm,
tests,
}:
@ -11,12 +11,13 @@ buildNpmPackage {
src = ./src;
inherit nodejs;
nodejs = nodejs-slim;
nativeBuildInputs = lib.optional (builtins.hasAttr "npm" nodejs-slim) nodejs-slim.npm;
npmDepsHash = "sha256-um6a4pEtPtdxHBRq9g5ZW20wIQAMjWJ3qF96XuxJg8o=";
postInstall = ''
makeWrapper ${lib.getExe nodejs} $out/bin/pnpm-fixup-state-db \
makeWrapper ${lib.getExe nodejs-slim} $out/bin/pnpm-fixup-state-db \
--add-flags "$out/lib/node_modules/pnpm-fixup-state-db"
'';