Skip to content

Commit

Permalink
direnvrc: do not set an empty NIX_SSL_CERT_FILE
Browse files Browse the repository at this point in the history
Otherwise python does not find any certificates
  • Loading branch information
Mic92 committed Apr 20, 2020
1 parent 9b5b553 commit ba30d7f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions direnvrc
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ use_nix() {
local tmp_backup=$TMPDIR
fi

local impure_ssl_cert_file=${SSL_CERT_FILE:-}
local impure_nix_ssl_cert_file=${NIX_SSL_CERT_FILE:-}
local impure_ssl_cert_file=${SSL_CERT_FILE:-__UNSET__}
local impure_nix_ssl_cert_file=${NIX_SSL_CERT_FILE:-__UNSET__}

log_status eval "$cache"
read -r cache_content < "$cache"
Expand All @@ -62,17 +62,17 @@ use_nix() {

# `nix-shell --pure` sets invalid ssl certificate paths
if [[ "${SSL_CERT_FILE:-}" = /no-cert-file.crt ]]; then
if [[ -n ${impure_ssl_cert_file+x} ]]; then
export SSL_CERT_FILE=${impure_ssl_cert_file}
else
if [[ ${impure_ssl_cert_file} == __UNSET__ ]]; then
unset SSL_CERT_FILE
else
export SSL_CERT_FILE=${impure_ssl_cert_file}
fi
fi
if [[ "${NIX_SSL_CERT_FILE:-}" = /no-cert-file.crt ]]; then
if [[ -n ${impure_nix_ssl_cert_file+x} ]]; then
export NIX_SSL_CERT_FILE=${impure_nix_ssl_cert_file}
else
if [[ ${impure_nix_ssl_cert_file} == __UNSET__ ]]; then
unset NIX_SSL_CERT_FILE
else
export NIX_SSL_CERT_FILE=${impure_nix_ssl_cert_file}
fi
fi

Expand Down

0 comments on commit ba30d7f

Please sign in to comment.