mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 16:26:18 +02:00
Merge pull request #4251 from serokell/mkaito/ops1098-nix-default-nix-path
Fix default nix-path
This commit is contained in:
commit
258e5338d6
1 changed files with 12 additions and 3 deletions
|
@ -2104,10 +2104,19 @@ EvalSettings::EvalSettings()
|
||||||
Strings EvalSettings::getDefaultNixPath()
|
Strings EvalSettings::getDefaultNixPath()
|
||||||
{
|
{
|
||||||
Strings res;
|
Strings res;
|
||||||
auto add = [&](const Path & p) { if (pathExists(p)) { res.push_back(p); } };
|
auto add = [&](const Path & p, const std::string & s = std::string()) {
|
||||||
|
if (pathExists(p)) {
|
||||||
|
if (s.empty()) {
|
||||||
|
res.push_back(p);
|
||||||
|
} else {
|
||||||
|
res.push_back(s + "=" + p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
add(getHome() + "/.nix-defexpr/channels");
|
add(getHome() + "/.nix-defexpr/channels");
|
||||||
add("nixpkgs=" + settings.nixStateDir + "/nix/profiles/per-user/root/channels/nixpkgs");
|
add(settings.nixStateDir + "/profiles/per-user/root/channels/nixpkgs", "nixpkgs");
|
||||||
add(settings.nixStateDir + "/nix/profiles/per-user/root/channels");
|
add(settings.nixStateDir + "/profiles/per-user/root/channels");
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue