diff options
Diffstat (limited to 'src/libstore/local-store.hh')
-rw-r--r-- | src/libstore/local-store.hh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh index 8bd37bc0a3af..6c366167f1ca 100644 --- a/src/libstore/local-store.hh +++ b/src/libstore/local-store.hh @@ -21,6 +21,20 @@ const int nixSchemaVersion = 4; extern string drvsLogDir; +struct OptimiseStats +{ + unsigned long totalFiles; + unsigned long sameContents; + unsigned long filesLinked; + unsigned long long bytesFreed; + OptimiseStats() + { + totalFiles = sameContents = filesLinked = 0; + bytesFreed = 0; + } +}; + + class LocalStore : public StoreAPI { private: @@ -83,6 +97,10 @@ public: void collectGarbage(GCAction action, const PathSet & pathsToDelete, bool ignoreLiveness, PathSet & result, unsigned long long & bytesFreed); + + /* Optimise the disk space usage of the Nix store by hard-linking + files with the same contents. */ + void optimiseStore(bool dryRun, OptimiseStats & stats); }; |