aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-04-26 14:01:21 +0200
committerEelco Dolstra <edolstra@gmail.com>2022-04-26 14:01:42 +0200
commit474695975dde60f582ca0b2fb72c17f664e22876 (patch)
tree3054af9cc5b2d73d71dfc88838ac248a062ed692 /src/nix
parentfab731a9d4622b1ecd7dea01895d9fbaf83301ea (diff)
EvalCache: Revert to using symbols in getAttr()
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/app.cc6
-rw-r--r--src/nix/flake.cc2
-rw-r--r--src/nix/search.cc2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/nix/app.cc b/src/nix/app.cc
index eec53ad7c..cce84d026 100644
--- a/src/nix/app.cc
+++ b/src/nix/app.cc
@@ -85,9 +85,9 @@ UnresolvedApp Installable::toApp(EvalState & state)
else if (type == "derivation") {
auto drvPath = cursor->forceDerivation();
- auto outPath = cursor->getAttr("outPath")->getString();
- auto outputName = cursor->getAttr("outputName")->getString();
- auto name = cursor->getAttr("name")->getString();
+ auto outPath = cursor->getAttr(state.sOutPath)->getString();
+ auto outputName = cursor->getAttr(state.sOutputName)->getString();
+ auto name = cursor->getAttr(state.sName)->getString();
auto aPname = cursor->maybeGetAttr("pname");
auto aMeta = cursor->maybeGetAttr("meta");
auto aMainProgram = aMeta ? aMeta->maybeGetAttr("mainProgram") : nullptr;
diff --git a/src/nix/flake.cc b/src/nix/flake.cc
index 2c4a64c85..040c1c7af 100644
--- a/src/nix/flake.cc
+++ b/src/nix/flake.cc
@@ -1012,7 +1012,7 @@ struct CmdFlakeShow : FlakeCommand, MixJSON
auto showDerivation = [&]()
{
- auto name = visitor.getAttr("name")->getString();
+ auto name = visitor.getAttr(state->sName)->getString();
if (json) {
std::optional<std::string> description;
if (auto aMeta = visitor.maybeGetAttr("meta")) {
diff --git a/src/nix/search.cc b/src/nix/search.cc
index 6febc0a55..76451f810 100644
--- a/src/nix/search.cc
+++ b/src/nix/search.cc
@@ -156,7 +156,7 @@ struct CmdSearch : InstallableCommand, MixJSON
recurse();
else if (attrPathS[0] == "legacyPackages" && attrPath.size() > 2) {
- auto attr = cursor.maybeGetAttr("recurseForDerivations");
+ auto attr = cursor.maybeGetAttr(state->sRecurseForDerivations);
if (attr && attr->getBool())
recurse();
}