diff options
author | Qyriad <qyriad@qyriad.me> | 2024-06-17 14:37:57 -0600 |
---|---|---|
committer | Qyriad <qyriad@qyriad.me> | 2024-06-20 17:00:06 +0000 |
commit | 079eeb1de72aeed6f9da16982c099d9936098ba6 (patch) | |
tree | 9be57474c6faa3d00cce7a3403d4788c838909dc /src/nix/run.cc | |
parent | b9e9235ac0dcb647f9d2bf81be682ce27ffb113f (diff) |
de-inheritance CmdRun for InstallableValueCommand
Change-Id: Ief858c1488197211e2ee8b70aa40ed6c65743558
Diffstat (limited to 'src/nix/run.cc')
-rw-r--r-- | src/nix/run.cc | 11 |
1 files changed, 7 insertions, 4 deletions
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<CmdShell>("shell"); -struct CmdRun : InstallableValueCommand +struct CmdRun : InstallableCommand { using InstallableCommand::run; @@ -191,12 +192,14 @@ struct CmdRun : InstallableValueCommand return res; } - void run(ref<Store> store, ref<InstallableValue> installable) override + void run(ref<Store> store, ref<Installable> 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); |