fetchPnpmDeps: allow passing existing derivation args

Previously, users had to add hacks to add additional nativeBuildInputs
entries to the fetcher. This way we allow users to append
nativeBuildInputs, impureEnvVars and also merge potential passthru
attributes.

This might cause rebuilds.

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu
2025-12-18 12:24:09 +01:00
parent e7dd455b9d
commit 63cdea5359
@@ -74,9 +74,11 @@ in
pnpm # from args
yq
zstd
];
]
++ args.nativeBuildInputs or [ ];
impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [ "NIX_NPM_REGISTRY" ];
impureEnvVars =
lib.fetchers.proxyImpureEnvVars ++ [ "NIX_NPM_REGISTRY" ] ++ args.impureEnvVars or [ ];
installPhase = ''
runHook preInstall
@@ -172,7 +174,7 @@ in
runHook postFixup
'';
passthru = {
passthru = args.passthru or { } // {
inherit fetcherVersion;
serve = callPackage ./serve.nix {
inherit pnpm; # from args