aboutsummaryrefslogtreecommitdiff
path: root/src/nix/eval.cc
diff options
context:
space:
mode:
authorQyriad <qyriad@qyriad.me>2024-06-17 14:33:28 -0600
committerQyriad <qyriad@qyriad.me>2024-06-20 17:00:06 +0000
commit1e5f13456075722c33f3348de61847b1bdf6b60c (patch)
tree818abb514dcfa42e9b9ddff2be5bbf3376e0225f /src/nix/eval.cc
parent8ba1939540a6f53166986446a5b8ee077591167a (diff)
de-inheritance CmdEval for InstallableValueCommand
Change-Id: I08b1702310e863d15de26dc838eb0bcb62417c10
Diffstat (limited to 'src/nix/eval.cc')
-rw-r--r--src/nix/eval.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nix/eval.cc b/src/nix/eval.cc
index 469ff7391..9f265930b 100644
--- a/src/nix/eval.cc
+++ b/src/nix/eval.cc
@@ -1,4 +1,4 @@
-#include "command-installable-value.hh"
+#include "command.hh"
#include "common-args.hh"
#include "print-options.hh"
#include "shared.hh"
@@ -12,13 +12,13 @@
using namespace nix;
-struct CmdEval : MixJSON, InstallableValueCommand, MixReadOnlyOption
+struct CmdEval : MixJSON, InstallableCommand, MixReadOnlyOption
{
bool raw = false;
std::optional<std::string> apply;
std::optional<Path> writeTo;
- CmdEval() : InstallableValueCommand()
+ CmdEval() : InstallableCommand()
{
addFlag({
.longName = "raw",
@@ -55,14 +55,16 @@ struct CmdEval : MixJSON, InstallableValueCommand, MixReadOnlyOption
Category category() override { return catSecondary; }
- void run(ref<Store> store, ref<InstallableValue> installable) override
+ void run(ref<Store> store, ref<Installable> installable) override
{
if (raw && json)
throw UsageError("--raw and --json are mutually exclusive");
+ auto const installableValue = InstallableValue::require(installable);
+
auto state = getEvalState();
- auto [v, pos] = installable->toValue(*state);
+ auto [v, pos] = installableValue->toValue(*state);
NixStringContext context;
if (apply) {