mirror of
https://github.com/NixOS/nix
synced 2025-07-06 05:01:48 +02:00
nix-env/nix-instantiate/nix-build: Support URIs
For instance, you can install Firefox from a specific Nixpkgs revision
like this:
$ nix-env -f 63def04891
.tar.gz -iA firefox
Or build a package from the latest nixpkgs-unstable channel:
$ nix-build https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz -A hello
This commit is contained in:
parent
0705d04dfa
commit
6519f06f39
5 changed files with 19 additions and 14 deletions
|
@ -183,10 +183,10 @@ int main(int argc, char * * argv)
|
|||
} else if (files.empty() && !fromArgs)
|
||||
files.push_back("./default.nix");
|
||||
|
||||
foreach (Strings::iterator, i, files) {
|
||||
for (auto & i : files) {
|
||||
Expr * e = fromArgs
|
||||
? state.parseExprFromString(*i, absPath("."))
|
||||
: state.parseExprFromFile(resolveExprPath(lookupFileArg(state, *i)));
|
||||
? state.parseExprFromString(i, absPath("."))
|
||||
: state.parseExprFromFile(resolveExprPath(lookupFileArg(state, i)));
|
||||
processExpr(state, attrPaths, parseOnly, strict, autoArgs,
|
||||
evalOnly, outputKind, xmlOutputSourceLocation, e);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue