stack: make sure cacert database is available when making HTTPS reqs

Resolves https://github.com/NixOS/nixpkgs/issues/499796.
This commit is contained in:
sternenseemann
2026-03-29 15:51:17 +02:00
parent 4e0b4e720d
commit d0ddc2664f
@@ -176,6 +176,29 @@ with haskellLib;
}
);
# Stack uses pure nix-shells for certain operations including HTTPS requests
# This patch makes stack add pkgs.cacert, so the certificate DB is available.
# https://github.com/commercialhaskell/stack/pull/6854 krank:ignore-line
stack =
appendPatches
[
(pkgs.fetchpatch {
name = "stack-add-cacert-to-pure-shells.patch";
url = "https://github.com/commercialhaskell/stack/commit/e869263cbd84a9e59ce1fa467e82993c8e7fb1dd.patch";
hash = "sha256-O7GaNgcGBY6m6GHqVtejqOu2HCWWKWXARPnr/upT1RQ=";
includes = [ "src/Stack/Nix.hs" ];
})
]
(
overrideCabal (drv: {
# Stack's source files use CRLF
prePatch = ''
${drv.prePatch or ""}
sed -i -e 's/\r$//' src/Stack/Nix.hs
'';
}) super.stack
);
# Extensions wants a specific version of Cabal for its list of Haskell
# language extensions.
extensions = doJailbreak (