NixOS / nixos-search

Search NixOS packages and options
https://search.nixos.org
MIT License
422 stars 109 forks source link

flake-info only accepts `nixos-*` Git references #849

Open uncenter opened 5 days ago

uncenter commented 5 days ago

Despite what the docs say:

https://github.com/NixOS/nixos-search/blob/081e9e64fc454b5ab9b4805da5cf6eb512526147/flake-info/README.md?plain=1#L87

The command does not accept any Git reference, just ones that are valid when prepended with nixos-. This is reflected/implemented here: https://github.com/NixOS/nixos-search/blob/081e9e64fc454b5ab9b4805da5cf6eb512526147/flake-info/src/data/source.rs#L123

So something like nixpkgs-unstable would lead to a 404 request panic because nixos-nixpkgs-unstable is not a real reference.

So this example provided does not work:

https://github.com/NixOS/nixos-search/blob/081e9e64fc454b5ab9b4805da5cf6eb512526147/flake-info/README.md?plain=1#L94

You would need to do flake-info nixpkgs 21.05 instead.

It's an easy fix to remove the nixos- prefix in the source code line highlighted above, however I am not sure what else would need to be changed to ensure the search instance deploys correctly or wherever else this command is used still functions.