feat(3p/nix): Add OptimiseStore

Change-Id: I0d254504801283e018eef41bd5ea9850b17c0d80
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1205
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
This commit is contained in:
Griffin Smith 2020-07-15 22:13:21 -04:00 committed by glittershark
parent b6cb681c0b
commit 3999439fbb
2 changed files with 6 additions and 1 deletions

View file

@ -630,12 +630,13 @@ static void performOp(TunnelLogger* logger, const ref<Store>& store,
break; break;
} }
case wopOptimiseStore: case wopOptimiseStore: {
logger->startWork(); logger->startWork();
store->optimiseStore(); store->optimiseStore();
logger->stopWork(); logger->stopWork();
to << 1; to << 1;
break; break;
}
case wopVerifyStore: { case wopVerifyStore: {
bool checkContents; bool checkContents;

View file

@ -78,6 +78,10 @@ service Worker {
// Return all currently valid derivations that have the given store path as an // Return all currently valid derivations that have the given store path as an
// output. // output.
rpc QueryValidDerivers(StorePath) returns (StorePaths); rpc QueryValidDerivers(StorePath) returns (StorePaths);
// Optimise the disk space usage of the Nix store by hard-linking files
// with the same contents.
rpc OptimiseStore(google.protobuf.Empty) returns (google.protobuf.Empty);
} }
enum HashType { enum HashType {