diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-04-17 14:30:04 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-04-17 14:30:04 +0200 |
commit | bdb32266079f13f687790426dcbe1941c6a959f0 (patch) | |
tree | 35fe0690b0e9ae688726ea92c837b55e7ce1dd27 /src/nix/flake.cc | |
parent | aa34c0ef512367fdc923c9fa0ec41345a4535fd0 (diff) |
Add flag to disable the eval cache
Diffstat (limited to 'src/nix/flake.cc')
-rw-r--r-- | src/nix/flake.cc | 8 |
1 files changed, 7 insertions, 1 deletions
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<AttrCursor> 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<AttrDb>(flake.getFingerprint()); + auto db = useEvalCache ? std::make_shared<AttrDb>(flake.getFingerprint()) : nullptr; auto root = std::make_shared<AttrRoot>(db, *state, [&]() |