nix-super/src/nix/optimise-store.cc

35 lines
679 B
C++
Raw Normal View History

#include "command.hh"
#include "shared.hh"
#include "store-api.hh"
#include <atomic>
using namespace nix;
struct CmdOptimiseStore : StoreCommand
{
std::string description() override
{
return "replace identical files in the store by hard links";
}
Examples examples() override
{
return {
Example{
"To optimise the Nix store:",
"nix optimise-store"
},
};
}
2020-05-05 16:18:23 +03:00
Category category() override { return catUtility; }
void run(ref<Store> store) override
{
store->optimiseStore();
}
};
static auto r1 = registerCommand<CmdOptimiseStore>("optimise-store");