Add "nix search" command

This commit is contained in:
Eelco Dolstra 2017-07-17 19:02:56 +02:00
parent 3162ad5ff4
commit 90825dea51
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
9 changed files with 263 additions and 102 deletions

View file

@ -12,7 +12,7 @@
namespace nix {
Value * InstallablesCommand::getSourceExpr(EvalState & state)
Value * SourceExprCommand::getSourceExpr(EvalState & state)
{
if (vSourceExpr) return vSourceExpr;
@ -59,6 +59,13 @@ Value * InstallablesCommand::getSourceExpr(EvalState & state)
return vSourceExpr;
}
ref<EvalState> SourceExprCommand::getEvalState()
{
if (!evalState)
evalState = std::make_shared<EvalState>(Strings{}, getStore());
return ref<EvalState>(evalState);
}
struct InstallableStoreDrv : Installable
{
Path storePath;
@ -237,13 +244,6 @@ PathSet InstallablesCommand::toStorePaths(ref<Store> store, ToStorePathsMode mod
return outPaths;
}
ref<EvalState> InstallablesCommand::getEvalState()
{
if (!evalState)
evalState = std::make_shared<EvalState>(Strings{}, getStore());
return ref<EvalState>(evalState);
}
void InstallablesCommand::prepare()
{
installables = parseInstallables(getStore(), _installables);