npm-lockfile-fix: add cacert for Darwin sandbox (#552041)

This commit is contained in:
Sandro
2026-08-20 18:45:34 +00:00
committed by GitHub

View File

@@ -1,8 +1,10 @@
{
lib,
stdenv,
python3,
fetchFromGitHub,
nix-update-script,
cacert,
}:
python3.pkgs.buildPythonApplication (finalAttrs: {
@@ -27,6 +29,16 @@ python3.pkgs.buildPythonApplication (finalAttrs: {
doCheck = false; # no tests
# requests resolves the CA bundle via REQUESTS_CA_BUNDLE before falling back
# to NIX_SSL_CERT_FILE, which on Darwin points to a host path that is not
# available inside a sandboxed build. Set it explicitly so the package works
# whenever it is invoked from a sandboxed environment.
makeWrapperArgs = lib.optionals stdenv.hostPlatform.isDarwin [
"--set"
"REQUESTS_CA_BUNDLE"
"${cacert}/etc/ssl/certs/ca-bundle.crt"
];
passthru.updateScript = nix-update-script { };
meta = {