build-support/node/prefetch-npm-deps: prepare for structuredAttrs

Move env variables into env, explicitly provide outputHash to
prefetch-npm-deps.
This commit is contained in:
Stefan Frijters
2026-02-07 15:07:00 +01:00
parent a4b9c6f754
commit 611910f00c
@@ -263,7 +263,7 @@
exit 1
fi
prefetch-npm-deps $srcLockfile $out
outputHash="${hash_.outputHash}" prefetch-npm-deps $srcLockfile $out
runHook postBuild
'';
@@ -274,29 +274,31 @@
# `{ "registry.example.com": "example-registry-bearer-token", ... }`
impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [ "NIX_NPM_TOKENS" ];
NIX_NPM_REGISTRY_OVERRIDES = npmRegistryOverridesString;
env = {
NIX_NPM_REGISTRY_OVERRIDES = npmRegistryOverridesString;
# Fetcher version controls which features are enabled in prefetch-npm-deps
# Version 2+ enables packument fetching for workspace support
NPM_FETCHER_VERSION = toString fetcherVersion;
# Fetcher version controls which features are enabled in prefetch-npm-deps
# Version 2+ enables packument fetching for workspace support
NPM_FETCHER_VERSION = toString fetcherVersion;
SSL_CERT_FILE =
if
(
hash_.outputHash == ""
|| hash_.outputHash == lib.fakeSha256
|| hash_.outputHash == lib.fakeSha512
|| hash_.outputHash == lib.fakeHash
)
then
"${cacert}/etc/ssl/certs/ca-bundle.crt"
else
"/no-cert-file.crt";
SSL_CERT_FILE =
if
(
hash_.outputHash == ""
|| hash_.outputHash == lib.fakeSha256
|| hash_.outputHash == lib.fakeSha512
|| hash_.outputHash == lib.fakeHash
)
then
"${cacert}/etc/ssl/certs/ca-bundle.crt"
else
"/no-cert-file.crt";
}
// forceGitDeps_
// forceEmptyCache_;
outputHashMode = "recursive";
}
// hash_
// forceGitDeps_
// forceEmptyCache_
);
}