aboutsummaryrefslogtreecommitdiff
path: root/src/nix/store-gc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix/store-gc.cc')
-rw-r--r--src/nix/store-gc.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nix/store-gc.cc b/src/nix/store-gc.cc
index a2d74066e..8b9b5d164 100644
--- a/src/nix/store-gc.cc
+++ b/src/nix/store-gc.cc
@@ -2,6 +2,8 @@
#include "common-args.hh"
#include "shared.hh"
#include "store-api.hh"
+#include "store-cast.hh"
+#include "gc-store.hh"
using namespace nix;
@@ -33,10 +35,12 @@ struct CmdStoreGC : StoreCommand, MixDryRun
void run(ref<Store> store) override
{
+ auto & gcStore = require<GcStore>(*store);
+
options.action = dryRun ? GCOptions::gcReturnDead : GCOptions::gcDeleteDead;
GCResults results;
PrintFreed freed(options.action == GCOptions::gcDeleteDead, results);
- store->collectGarbage(options, results);
+ gcStore.collectGarbage(options, results);
}
};