Skip to content

Commit 23f07fa

Browse files
committed
nix-profile.fish: Look for ca-bundle.crt in $NIX_PROFILES
There seems to be no good reason for `nix-profile.fish` and `nix-profile-daemon.fish` to differ in how they look for the location of the `ca-bundle.crt` that might be installed by one of the packages. As `$NIX_PROFILES` points to user local paths, not checking there is strictly less useful, it seems?
1 parent d2425c5 commit 23f07fa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/nix-profile.fish.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ else if test -e "$NIX_LINK/etc/ssl/certs/ca-bundle.crt" # fall back to cacert in
5353
set --export NIX_SSL_CERT_FILE "$NIX_LINK/etc/ssl/certs/ca-bundle.crt"
5454
else if test -e "$NIX_LINK/etc/ca-bundle.crt" # old cacert in Nix profile
5555
set --export NIX_SSL_CERT_FILE "$NIX_LINK/etc/ca-bundle.crt"
56+
else
57+
# Fall back to what is in the nix profiles, favouring whatever is defined last.
58+
for i in (string split ' ' $NIX_PROFILES)
59+
if test -e "$i/etc/ssl/certs/ca-bundle.crt"
60+
set --export NIX_SSL_CERT_FILE "$i/etc/ssl/certs/ca-bundle.crt"
61+
end
62+
end
5663
end
5764

5865
# Only use MANPATH if it is already set. In general `man` will just simply

0 commit comments

Comments
 (0)