logoalt Hacker News

pxcyesterday at 5:57 PM3 repliesview on HN

Who has?

Nixpkgs has. :)

Nowadays the only search like this I need to run is

  nix-locate -r 'bin/foo$'
It would be nice to have a CLI alternative to Repology, though.

Replies

sestepyesterday at 9:20 PM

Another great tool, built on top of nix-locate, is comma. So for any program foo, if you have foo installed, you can run it like this:

  foo
And if you don't have it installed, you can run it (without installing!) like this:

  , foo
And if multiple different packages provide a program named bin/foo then comma lets you interactively choose the one you want, and remembers your choice so you don't have to specify again unless you choose to via the -d flag.
arikrahmantoday at 2:21 AM

I've been using https://search.nixos.org/ this whole time to find packages. Thanks for dropping this!

foobarquxtoday at 12:10 AM

....

     function repology() {
         curl -L --user-agent 'hackernews' \
             "http://repology.org/api/v1/project/$@"
    }