diff options
Diffstat (limited to 'src/nix/store-delete.cc')
-rw-r--r-- | src/nix/store-delete.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nix/store-delete.cc b/src/nix/store-delete.cc index e4a3cb554..ca43f1530 100644 --- a/src/nix/store-delete.cc +++ b/src/nix/store-delete.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; @@ -32,12 +34,14 @@ struct CmdStoreDelete : StorePathsCommand void run(ref<Store> store, std::vector<StorePath> && storePaths) override { + auto & gcStore = require<GcStore>(*store); + for (auto & path : storePaths) options.pathsToDelete.insert(path); GCResults results; PrintFreed freed(true, results); - store->collectGarbage(options, results); + gcStore.collectGarbage(options, results); } }; |