diff --git a/pkgs/build-support/node/prefetch-npm-deps/default.nix b/pkgs/build-support/node/prefetch-npm-deps/default.nix index bfa8fb863e4b..12c56a58b6ec 100644 --- a/pkgs/build-support/node/prefetch-npm-deps/default.nix +++ b/pkgs/build-support/node/prefetch-npm-deps/default.nix @@ -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_ ); }