mirror of
https://github.com/NixOS/nix
synced 2025-07-07 22:33:57 +02:00
parent
24e1dc4d74
commit
a1c22a7c10
1 changed files with 10 additions and 5 deletions
|
@ -2525,12 +2525,17 @@ Strings EvalSettings::getDefaultNixPath()
|
||||||
{
|
{
|
||||||
Strings res;
|
Strings res;
|
||||||
auto add = [&](const Path & p, const std::string & s = std::string()) {
|
auto add = [&](const Path & p, const std::string & s = std::string()) {
|
||||||
if (pathExists(p)) {
|
try {
|
||||||
if (s.empty()) {
|
if (pathExists(p)) {
|
||||||
res.push_back(p);
|
if (s.empty()) {
|
||||||
} else {
|
res.push_back(p);
|
||||||
res.push_back(s + "=" + p);
|
} else {
|
||||||
|
res.push_back(s + "=" + p);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (SysError & e) {
|
||||||
|
// swallow EPERM
|
||||||
|
if (e.errNo != EPERM) throw;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue