Cleaning up package metadata

I’ve started developing an alternative to nix search in Rust (here) and have decided to do so by downloading and parsing the package-nixos-*.json files that are used on the website for searching. However, I’m running into a bunch of issues with how loosely written the JSON-files are. As of right now I’ve hit six different ways that licenses are structured in the files, and at least two different ways that maintainers are structured. So far I’ve been working around them, which is annoying. However, I was wondering if it would be worth my time to clean up these discrepancies in the packages themselves and submit them as one large PR to make them consistent?

Alternatively, how and where does the builtin nix search command get/build its output? The JSON it uses is far more structured.

The source for nix search can be found here: https://github.com/NixOS/nix/blob/906d56a96b442d4dd8f924c1ce0d1eec0e214af3/src/nix/search.cc

It looks like it sees if there’s a pre-built cache, in which it will just query that for result, or it will evaluate your package set directory and look for derivations.

if you dont mind shelling out, you may want to look into nix search -q --json, but then you’re not re-writing nix search, you’re building on top of it. : /