Skip to content

Commit 4aaa200

Browse files
authored
Add cacert to wrapped-cabal runtimeInputs for SSL certificate support (#232)
curl requires CA certificates to validate HTTPS connections. In the -env containers (rootless, no system CA store), OpenSSL falls back to /no-cert-file.crt when cacert is not in the dependency closure. Adding pkgs.cacert to runtimeInputs propagates it through nix-support/, and its setup-hook sets SSL_CERT_FILE, NIX_SSL_CERT_FILE, and SYSTEM_CERTIFICATE_PATH — enabling curl to verify HTTPS certificates in the container environment. Fixes: curl: (77) error adding trust anchors from file: /no-cert-file.crt
1 parent 8cbcf3d commit 4aaa200

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

cross-js.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ let tool-version-map = (import ./tool-map.nix) self;
1919
# See writers.nix for why writeShellApplicationWithRuntime is needed.
2020
wrapped-cabal = writers.writeShellApplicationWithRuntime {
2121
name = "cabal";
22-
runtimeInputs = [ cabal-install pkgs.curl ];
22+
runtimeInputs = [ cabal-install pkgs.curl pkgs.cacert ];
2323
text = with pkgs; ''
2424
# We do not want to quote NIX_CABAL_FLAGS
2525
# it will leave an empty argument, if they are empty.

cross-windows.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ let tool-version-map = (import ./tool-map.nix) self;
8181
# See writers.nix for why writeShellApplicationWithRuntime is needed.
8282
wrapped-cabal = writers.writeShellApplicationWithRuntime {
8383
name = "cabal";
84-
runtimeInputs = [ cabal-install curl ];
84+
runtimeInputs = [ cabal-install curl pkgs.pkgsBuildBuild.cacert ];
8585
text = ''
8686
# We do not want to quote NIX_CABAL_FLAGS
8787
# it will leave an empty argument, if they are empty.

dynamic.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ let tool-version-map = (import ./tool-map.nix) self;
4646
# See writers.nix for why writeShellApplicationWithRuntime is needed.
4747
wrapped-cabal = writers.writeShellApplicationWithRuntime {
4848
name = "cabal";
49-
runtimeInputs = [ cabal-install pkgs.curl ];
49+
runtimeInputs = [ cabal-install pkgs.curl pkgs.cacert ];
5050
text = ''
5151
case "$1" in
5252
build) cabal "$@"

static.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ let tool-version-map = (import ./tool-map.nix) self;
3535
# See writers.nix for why writeShellApplicationWithRuntime is needed.
3636
wrapped-cabal = writers.writeShellApplicationWithRuntime {
3737
name = "cabal";
38-
runtimeInputs = [ cabal-install pkgs.curl ];
38+
runtimeInputs = [ cabal-install pkgs.curl pkgs.cacert ];
3939
text = with pkgs; ''
4040
# We do not want to quote NIX_CABAL_FLAGS
4141
# it will leave an empty argument, if they are empty.

0 commit comments

Comments
 (0)