The Nix store is an immutable file tree store, addressed by output hashes ($outhash-$name
or $out
), but could also be tweaked to be addressed by the content hash of the file tree ($cas
).
Git is a content-addressed immutable object store. It is optimized for storing files as blobs and directories as tree objects.
Here we consider using a git repository for deduplicating, compressing and distributing the Nix store. We want to achieve maximum deduplication so we extract small changes from files before storing, so they become more similar.