2016-02-09 20:34:24 +00:00
|
|
|
|
#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;
|
|
|
|
|
|
2016-08-23 15:11:19 +00:00
|
|
|
|
struct Value;
|
|
|
|
|
class EvalState;
|
|
|
|
|
|
2016-02-09 20:34:24 +00:00
|
|
|
|
struct MixInstallables : virtual Args
|
|
|
|
|
{
|
|
|
|
|
Strings installables;
|
2016-08-23 15:11:19 +00:00
|
|
|
|
Path file;
|
2016-02-09 20:34:24 +00:00
|
|
|
|
|
|
|
|
|
MixInstallables()
|
|
|
|
|
{
|
|
|
|
|
mkFlag('f', "file", "file", "evaluate FILE rather than the default", &file);
|
|
|
|
|
expectArgs("installables", &installables);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UserEnvElems evalInstallables(ref<Store> store);
|
2016-08-23 15:11:19 +00:00
|
|
|
|
|
|
|
|
|
/* Return a value representing the Nix expression from which we
|
2016-11-25 23:37:43 +00:00
|
|
|
|
are installing. This is either the file specified by ‘--file’,
|
|
|
|
|
or an attribute set constructed from $NIX_PATH, e.g. ‘{ nixpkgs
|
|
|
|
|
= import ...; bla = import ...; }’. */
|
2016-08-23 15:11:19 +00:00
|
|
|
|
Value * buildSourceExpr(EvalState & state);
|
|
|
|
|
|
2016-02-09 20:34:24 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|