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.
This commit is contained in:
parent
22d6e31fc6
commit
d74236d1f2
5 changed files with 57 additions and 13 deletions
|
|
@ -21,10 +21,13 @@ struct UserEnvElem
|
|||
|
||||
typedef std::vector<UserEnvElem> UserEnvElems;
|
||||
|
||||
struct Value;
|
||||
class EvalState;
|
||||
|
||||
struct MixInstallables : virtual Args
|
||||
{
|
||||
Strings installables;
|
||||
Path file = "<nixpkgs>";
|
||||
Path file;
|
||||
|
||||
MixInstallables()
|
||||
{
|
||||
|
|
@ -33,6 +36,13 @@ struct MixInstallables : virtual Args
|
|||
}
|
||||
|
||||
UserEnvElems evalInstallables(ref<Store> store);
|
||||
|
||||
/* Return a value representing the Nix expression from which we
|
||||
are installing. This is either the file specified by ‘--file’,
|
||||
or an attribute set constructed from $NIX_PATH, e.g. ‘{ nixpkgs
|
||||
= import ...; bla = import ...; }’. */
|
||||
Value * buildSourceExpr(EvalState & state);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue