2017-08-16 15:00:24 +00:00
|
|
|
#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";
|
|
|
|
}
|
|
|
|
|
2020-12-09 22:54:11 +00:00
|
|
|
std::string doc() override
|
2017-08-16 15:00:24 +00:00
|
|
|
{
|
2020-12-09 22:54:11 +00:00
|
|
|
return
|
|
|
|
#include "optimise-store.md"
|
|
|
|
;
|
2017-08-16 15:00:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void run(ref<Store> store) override
|
|
|
|
{
|
|
|
|
store->optimiseStore();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-07-24 18:38:56 +00:00
|
|
|
static auto rCmdOptimiseStore = registerCommand2<CmdOptimiseStore>({"store", "optimise"});
|