From 079eeb1de72aeed6f9da16982c099d9936098ba6 Mon Sep 17 00:00:00 2001 From: Qyriad Date: Mon, 17 Jun 2024 14:37:57 -0600 Subject: de-inheritance CmdRun for InstallableValueCommand Change-Id: Ief858c1488197211e2ee8b70aa40ed6c65743558 --- src/nix/run.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/nix/run.cc') diff --git a/src/nix/run.cc b/src/nix/run.cc index e1e896bb4..1e4406df5 100644 --- a/src/nix/run.cc +++ b/src/nix/run.cc @@ -1,6 +1,7 @@ #include "run.hh" -#include "command-installable-value.hh" +#include "command.hh" #include "common-args.hh" +#include "installables.hh" #include "shared.hh" #include "store-api.hh" #include "derivations.hh" @@ -145,7 +146,7 @@ struct CmdShell : InstallablesCommand, MixEnvironment static auto rCmdShell = registerCommand("shell"); -struct CmdRun : InstallableValueCommand +struct CmdRun : InstallableCommand { using InstallableCommand::run; @@ -191,12 +192,14 @@ struct CmdRun : InstallableValueCommand return res; } - void run(ref store, ref installable) override + void run(ref store, ref installable) override { auto state = getEvalState(); + auto installableValue = InstallableValue::require(installable); + lockFlags.applyNixConfig = true; - auto app = installable->toApp(*state).resolve(getEvalStore(), store); + auto app = installableValue->toApp(*state).resolve(getEvalStore(), store); Strings allArgs{app.program}; for (auto & i : args) allArgs.push_back(i); -- cgit v1.2.3