nix-community / nix-index

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

Add nix-channel-index (and also some minor refactoring) #192

Closed K900 closed 1 year ago

K900 commented 1 year ago

This adds a new tool that allows generating SQLite databases compatible with the default Nix command-not-found implementation. The intent is to eventually replace the current command-not-found database generation code (which is painfully slow) with this implementation to hopefully massively speed up channel updates.

bennofs commented 1 year ago

Thanks! I don't have time right now to review this, but hopefully will be able to look at this after christmas

K900 commented 1 year ago

Rebased, fixed all the nits, added some more refactoring on top.

K900 commented 1 year ago

With the current version of this PR, I can eval + index all of nixpkgs for the four major platforms ({aarch64,x86_64}-{linux,darwin}) in under three minutes.

K900 commented 1 year ago

Hopefully last push of the night, fixed symlinks in /bin not being indexed.

K900 commented 1 year ago

And of course just as I said that, I found another bug. We should ignore non-toplevel paths for c-n-f, as they're not installable.

K900 commented 1 year ago

Hopefully the last few changes to get us closer to the old database (mostly based on carefully comparing things by eye). The delta for x86_64-linux is down to ~2400 entries out of ~64000, and at a glance the new version mostly looks better.

K900 commented 1 year ago

Database diff: https://gist.github.com/K900/5144715c4747da1871c16782ca0c083e

ncfavier commented 1 year ago

This has now landed in nixpkgs!