diff options
Diffstat (limited to 'src/nix/installables.hh')
-rw-r--r-- | src/nix/installables.hh | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/src/nix/installables.hh b/src/nix/installables.hh deleted file mode 100644 index 5f0b0a292242..000000000000 --- a/src/nix/installables.hh +++ /dev/null @@ -1,61 +0,0 @@ -#pragma once - -#include "args.hh" -#include "command.hh" - -namespace nix { - -struct Value; -class EvalState; -class Expr; - -struct Installable -{ - virtual std::string what() = 0; - - virtual PathSet toBuildable() - { - throw Error("argument ‘%s’ cannot be built", what()); - } - - virtual Value * toValue(EvalState & state) - { - throw Error("argument ‘%s’ cannot be evaluated", what()); - } -}; - -struct MixInstallables : virtual Args, StoreCommand -{ - std::vector<std::shared_ptr<Installable>> installables; - Path file; - - MixInstallables() - { - mkFlag('f', "file", "file", "evaluate FILE rather than the default", &file); - expectArgs("installables", &_installables); - } - - /* 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 * getSourceExpr(EvalState & state); - - std::vector<std::shared_ptr<Installable>> parseInstallables(ref<Store> store, Strings installables); - - PathSet buildInstallables(ref<Store> store, bool dryRun); - - ref<EvalState> getEvalState(); - - void prepare() override; - -private: - - Strings _installables; - - std::shared_ptr<EvalState> evalState; - - Value * vSourceExpr = 0; -}; - -} |