aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQyriad <qyriad@qyriad.me>2024-06-17 14:41:22 -0600
committerQyriad <qyriad@qyriad.me>2024-06-20 17:00:06 +0000
commit6515b1a4954131010a7b19acf98dc010dde647d0 (patch)
treedcf1440dffbdf6b220ccfab614ecc4684402870a
parent50be55ffca4d25e4e19175c18cd88f6046757652 (diff)
de-inheritance CmdSearch for InstallableValueCommand
Change-Id: I125c8cac05c8e924b55e4eb1060496e35ea4e941
-rw-r--r--src/nix/search.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/nix/search.cc b/src/nix/search.cc
index 97ef1375e..9f6b7a24e 100644
--- a/src/nix/search.cc
+++ b/src/nix/search.cc
@@ -1,4 +1,4 @@
-#include "command-installable-value.hh"
+#include "command.hh"
#include "globals.hh"
#include "eval.hh"
#include "eval-inline.hh"
@@ -23,7 +23,7 @@ std::string wrap(std::string prefix, std::string s)
return concatStrings(prefix, s, ANSI_NORMAL);
}
-struct CmdSearch : InstallableValueCommand, MixJSON
+struct CmdSearch : InstallableCommand, MixJSON
{
std::vector<std::string> res;
std::vector<std::string> excludeRes;
@@ -62,8 +62,10 @@ struct CmdSearch : InstallableValueCommand, MixJSON
};
}
- void run(ref<Store> store, ref<InstallableValue> installable) override
+ void run(ref<Store> store, ref<Installable> installable) override
{
+ auto const installableValue = InstallableValue::require(installable);
+
settings.readOnlyMode = true;
evalSettings.enableImportFromDerivation.setDefault(false);
@@ -192,7 +194,7 @@ struct CmdSearch : InstallableValueCommand, MixJSON
}
};
- for (auto & cursor : installable->getCursors(*state))
+ for (auto & cursor : installableValue->getCursors(*state))
visit(*cursor, cursor->getAttrPath(), true);
if (json)