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: 8abb8647a33c
Choose a base ref
...
head repository: NixOS/nix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8cb3bbd5044b
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on May 31, 2019

  1. Copy the full SHA
    8cb3bbd View commit details
Showing with 7 additions and 4 deletions.
  1. +4 −4 src/nix/installables.cc
  2. +3 −0 tests/flakes.sh
8 changes: 4 additions & 4 deletions src/nix/installables.cc
Original file line number Diff line number Diff line change
@@ -314,6 +314,10 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables(
Strings{"packages." + std::string(s, 8)}));
}

else if (auto flakeRef = parseFlakeRef(s, true))
result.push_back(std::make_shared<InstallableFlake>(*this, s,
getDefaultFlakeAttrPaths()));

else if ((colon = s.rfind(':')) != std::string::npos) {
auto flakeRef = std::string(s, 0, colon);
auto attrPath = std::string(s, colon + 1);
@@ -332,10 +336,6 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables(
getDefaultFlakeAttrPaths()));
}

else if (auto flakeRef = parseFlakeRef(s, true))
result.push_back(std::make_shared<InstallableFlake>(*this, s,
getDefaultFlakeAttrPaths()));

else
result.push_back(std::make_shared<InstallableFlake>(*this, FlakeRef("nixpkgs"), s));
}
3 changes: 3 additions & 0 deletions tests/flakes.sh
Original file line number Diff line number Diff line change
@@ -134,6 +134,9 @@ nix build -o $TEST_ROOT/result --flake-registry $registry flake1:foo
nix build -o $TEST_ROOT/result --flake-registry $registry flake1
[[ -e $TEST_ROOT/result/hello ]]

nix build -o $TEST_ROOT/result --flake-registry $registry $flake1Dir
nix build -o $TEST_ROOT/result --flake-registry $registry file://$flake1Dir

# Building a flake with an unlocked dependency should fail in pure mode.
(! nix eval "(builtins.getFlake "$flake2Dir")")