From c769841bc4ecb9dd3d8456931fec78e102c3832f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 25 Apr 2017 12:06:32 +0200 Subject: Move code around --- src/nix/installables.hh | 61 ------------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 src/nix/installables.hh (limited to 'src/nix/installables.hh') 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> 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> parseInstallables(ref store, Strings installables); - - PathSet buildInstallables(ref store, bool dryRun); - - ref getEvalState(); - - void prepare() override; - -private: - - Strings _installables; - - std::shared_ptr evalState; - - Value * vSourceExpr = 0; -}; - -} -- cgit 1.4.1