mirror of
https://github.com/NixOS/nix
synced 2025-06-28 13:41:15 +02:00
create pathAccessible, use it to infer default dirs
This commit is contained in:
parent
a6c78ba367
commit
2c462486fe
5 changed files with 26 additions and 14 deletions
|
@ -57,8 +57,6 @@ Settings::Settings()
|
|||
auto sslOverride = getEnv("NIX_SSL_CERT_FILE").value_or(getEnv("SSL_CERT_FILE").value_or(""));
|
||||
if (sslOverride != "")
|
||||
caFile = sslOverride;
|
||||
else if (caFile == "")
|
||||
caFile = getDefaultSSLCertFile();
|
||||
|
||||
/* Backwards compatibility. */
|
||||
auto s = getEnv("NIX_REMOTE_SYSTEMS");
|
||||
|
@ -185,7 +183,7 @@ bool Settings::isWSL1()
|
|||
Path Settings::getDefaultSSLCertFile()
|
||||
{
|
||||
for (auto & fn : {"/etc/ssl/certs/ca-certificates.crt", "/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"})
|
||||
if (pathExists(fn)) return fn;
|
||||
if (pathAccessible(fn)) return fn;
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue