nix-community / nix-index

Quickly locate nix packages with specific files [maintainers=@bennofs @figsoda @raitobezarius]
Other
785 stars 50 forks source link

Could nix-index make store optimization faster? #229

Open mikepurvis opened 1 year ago

mikepurvis commented 1 year ago

Running nix store optimize can be slow on even relatively small stores, since it needs to hash everything to find files that are identical between store paths. Could there be a role for nix-index in supplying individual file hashes for known store paths, so that optimization becomes trivial?

SuperSandro2000 commented 9 months ago

Could there be a role for nix-index in supplying individual file hashes for known store paths, so that optimization becomes trivial?

The cache of nix-index is not always up to date and identically to the nix store but since binaries rarely move around that is not a problem. Using such stale cache for optimization is probably not beneficial.