Nix's auto-optimise-store creates content-addressed entries under /nix/store/.links and hard-links to them throughout the store to provide store-wide, per-file deduplication.
However, given a large enough Nix store, the number of entries can exceed the maximum number of entries for a directory on EXT4. Additionally, some tools handle large directories poorly.
One approach is to shard /nix/store/.links using a two-character prefix (the first two characters of the content-addressed hash).
Nix's
auto-optimise-storecreates content-addressed entries under/nix/store/.linksand hard-links to them throughout the store to provide store-wide, per-file deduplication.However, given a large enough Nix store, the number of entries can exceed the maximum number of entries for a directory on EXT4. Additionally, some tools handle large directories poorly.
One approach is to shard
/nix/store/.linksusing a two-character prefix (the first two characters of the content-addressed hash).