From bdb32266079f13f687790426dcbe1941c6a959f0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 17 Apr 2020 14:30:04 +0200 Subject: [PATCH] Add flag to disable the eval cache --- src/nix/flake.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/nix/flake.cc b/src/nix/flake.cc index 753e9e29a..c78e6f2f1 100644 --- a/src/nix/flake.cc +++ b/src/nix/flake.cc @@ -976,6 +976,7 @@ struct AttrCursor : std::enable_shared_from_this struct CmdFlakeShow : FlakeCommand { bool showLegacy = false; + bool useEvalCache = true; CmdFlakeShow() { @@ -983,6 +984,11 @@ struct CmdFlakeShow : FlakeCommand .longName("legacy") .description("show the contents of the 'legacyPackages' output") .set(&showLegacy, true); + + mkFlag() + .longName("no-eval-cache") + .description("do not use the flake evaluation cache") + .handler([&]() { useEvalCache = false; }); } std::string description() override @@ -1111,7 +1117,7 @@ struct CmdFlakeShow : FlakeCommand } }; - auto db = std::make_shared(flake.getFingerprint()); + auto db = useEvalCache ? std::make_shared(flake.getFingerprint()) : nullptr; auto root = std::make_shared(db, *state, [&]()