1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

Allow URLs in the Nix search path

E.g. to install "hello" from the latest Nixpkgs:

  $ nix-build '<nixpkgs>' -A hello -I nixpkgs=https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz

Or to install a specific version of NixOS:

  $ nixos-rebuild switch -I nixpkgs=63def04891.tar.gz
This commit is contained in:
Eelco Dolstra 2015-05-05 17:09:42 +02:00
parent 35d30d67eb
commit 9451ef3731
6 changed files with 123 additions and 99 deletions

View file

@ -155,14 +155,16 @@ int main(int argc, char * * argv)
return true;
});
if (evalOnly && !wantsReadWrite)
settings.readOnlyMode = true;
store = openStore();
EvalState state(searchPath);
state.repair = repair;
Bindings & autoArgs(*evalAutoArgs(state, autoArgs_));
if (evalOnly && !wantsReadWrite)
settings.readOnlyMode = true;
if (attrPaths.empty()) attrPaths.push_back("");
if (findFile) {
@ -174,8 +176,6 @@ int main(int argc, char * * argv)
return;
}
store = openStore();
if (readStdin) {
Expr * e = parseStdin(state);
processExpr(state, attrPaths, parseOnly, strict, autoArgs,