lix/src/nix/installables.hh
Eelco Dolstra d74236d1f2 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.
2016-08-23 17:11:19 +02:00

49 lines
988 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include "args.hh"
namespace nix {
struct UserEnvElem
{
Strings attrPath;
// FIXME: should use boost::variant or so.
bool isDrv;
// Derivation case:
Path drvPath;
StringSet outputNames;
// Non-derivation case:
PathSet outPaths;
};
typedef std::vector<UserEnvElem> UserEnvElems;
struct Value;
class EvalState;
struct MixInstallables : virtual Args
{
Strings installables;
Path file;
MixInstallables()
{
mkFlag('f', "file", "file", "evaluate FILE rather than the default", &file);
expectArgs("installables", &installables);
}
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);
};
}