diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-02-09T20·34+0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-02-09T20·34+0100 |
commit | 206bbb5dc9f714db51cdae973de9efef71d96cf7 (patch) | |
tree | 54fc97eb0ce963666337b45c76e35086058ac3be /src/nix/installables.hh | |
parent | cd2196b08981a96cf607ad4a8f2f0dfa8cdf2add (diff) |
Add basic "nix build" command
Currently only builds by attribute from <nixpkgs> or the specified file, e.g. "nix build hello".
Diffstat (limited to 'src/nix/installables.hh')
-rw-r--r-- | src/nix/installables.hh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/nix/installables.hh b/src/nix/installables.hh new file mode 100644 index 000000000000..5eb897d46148 --- /dev/null +++ b/src/nix/installables.hh @@ -0,0 +1,38 @@ +#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 MixInstallables : virtual Args +{ + Strings installables; + Path file = "<nixpkgs>"; + + MixInstallables() + { + mkFlag('f', "file", "file", "evaluate FILE rather than the default", &file); + expectArgs("installables", &installables); + } + + UserEnvElems evalInstallables(ref<Store> store); +}; + +} |