Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nix
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 905f6678e8e9
Choose a base ref
...
head repository: NixOS/nix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 258e5338d68c
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Nov 12, 2020

  1. Fix default nix-path

    The default nix-path values for nixpkgs and root channels were
    incorrect.
    mkaito committed Nov 12, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    Ma27 Maximilian Bosch
    Copy the full SHA
    c4c3c15 View commit details
  2. Merge pull request #4251 from serokell/mkaito/ops1098-nix-default-nix…

    …-path
    
    Fix default nix-path
    edolstra authored Nov 12, 2020
    Copy the full SHA
    258e533 View commit details
Showing with 12 additions and 3 deletions.
  1. +12 −3 src/libexpr/eval.cc
15 changes: 12 additions & 3 deletions src/libexpr/eval.cc
Original file line number Diff line number Diff line change
@@ -2104,10 +2104,19 @@ EvalSettings::EvalSettings()
Strings EvalSettings::getDefaultNixPath()
{
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("nixpkgs=" + settings.nixStateDir + "/nix/profiles/per-user/root/channels/nixpkgs");
add(settings.nixStateDir + "/nix/profiles/per-user/root/channels");
add(settings.nixStateDir + "/profiles/per-user/root/channels/nixpkgs", "nixpkgs");
add(settings.nixStateDir + "/profiles/per-user/root/channels");
return res;
}