From 23f07fa974f37c4660066e0dcaf2d3c9c1ecabd5 Mon Sep 17 00:00:00 2001 From: Illia Bobyr Date: Mon, 13 Jan 2025 19:20:13 -0800 Subject: [PATCH] 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? --- scripts/nix-profile.fish.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/nix-profile.fish.in b/scripts/nix-profile.fish.in index 05d9a187d..59b3c695e 100644 --- a/scripts/nix-profile.fish.in +++ b/scripts/nix-profile.fish.in @@ -53,6 +53,13 @@ else if test -e "$NIX_LINK/etc/ssl/certs/ca-bundle.crt" # fall back to cacert in set --export NIX_SSL_CERT_FILE "$NIX_LINK/etc/ssl/certs/ca-bundle.crt" else if test -e "$NIX_LINK/etc/ca-bundle.crt" # old cacert in Nix profile set --export NIX_SSL_CERT_FILE "$NIX_LINK/etc/ca-bundle.crt" +else + # Fall back to what is in the nix profiles, favouring whatever is defined last. + for i in (string split ' ' $NIX_PROFILES) + if test -e "$i/etc/ssl/certs/ca-bundle.crt" + set --export NIX_SSL_CERT_FILE "$i/etc/ssl/certs/ca-bundle.crt" + end + end end # Only use MANPATH if it is already set. In general `man` will just simply