From d74236d1f2c3bca4fcc8cb1574fb962e813f69d3 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 23 Aug 2016 17:11:19 +0200 Subject: nix build: Use Nix search path That is, unless --file is specified, the Nix search path is synthesized into an attribute set. Thus you can say $ nix build nixpkgs.hello assuming $NIX_PATH contains an entry of the form "nixpkgs=...". This is more verbose than $ nix build hello but is less ambiguous. --- src/nix-env/nix-env.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/nix-env') diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc index 3f0486bb6541..955a2466102f 100644 --- a/src/nix-env/nix-env.cc +++ b/src/nix-env/nix-env.cc @@ -128,9 +128,8 @@ static void getAllExprs(EvalState & state, } attrs.insert(attrName); /* Load the expression on demand. */ - Value & vFun(*state.allocValue()); + Value & vFun = state.getBuiltin("import"); Value & vArg(*state.allocValue()); - state.getBuiltin("import", vFun); mkString(vArg, path2); if (v.attrs->size() == v.attrs->capacity()) throw Error(format("too many Nix expressions in directory ‘%1%’") % path); -- cgit 1.4.1