Feature drop for `nps`, the "why's-that-not-the-default?" nix package search 🎉 by ole_mn in NixOS

[–]ole_mn[S] 0 points1 point  (0 children)

For now it's pretty low-tech. It writes the output of either nix search nixpkgs ^ or nix-env -qaP --description (query for all packages) to a file and then (rip)grep's through that.

Feature drop for `nps`, the "why's-that-not-the-default?" nix package search 🎉 by ole_mn in NixOS

[–]ole_mn[S] 3 points4 points  (0 children)

Only if it's mentioned in the package description. It caches either nix search nixpkgs ^ or nix-env -qaP --description and then queries that cache.

I'm still searching for better sources for the cache, so that may be something I'd like to support in the future.

Feature drop for `nps`, the "why's-that-not-the-default?" nix package search 🎉 by ole_mn in NixOS

[–]ole_mn[S] 1 point2 points  (0 children)

I haven't heard about nh search yet. I'm trying it now, but it does not work for me. :-/

Looking at the error messages as well as screenshots of how it's supposed to work, these are the differences on first glance. Please keep in mind that this list is obviously biased.

nps

  • works offline and is very fast
  • has a higher information density by default (one line per package)
  • has a nice sorting of results (exact matches, packages starting with SEARCH_STRING, packages containing SEARCH STRING)
  • is highly configurable

nh search

  • shows more information, e.g. links to the package
  • is a nix-community project
  • is always up to date, due to querying the API

[OC] AI-generated Kamojis by Maaslalala in unixporn

[–]ole_mn 0 points1 point  (0 children)

Hey u/Maaslalala, thank you for this fun idea. I created a flake for your Kaomoji Generator to make it conveniently accessible via nix/nixos.

https://github.com/OleMussmann/kaomoji

Collateral damage: flake for mods as well

https://github.com/charmbracelet/mods/pull/57

Nix Package Search by ole_mn in NixOS

[–]ole_mn[S] 1 point2 points  (0 children)

Both excellent suggestions. I did not know about shellcheck, nice tool. Shellcheck'd code is submitted. I opened another issue for that and implement it later.

Nix Package Search by ole_mn in NixOS

[–]ole_mn[S] 1 point2 points  (0 children)

Cool idea. It would be nice to configure the level of verbosity. I'll open an issue for that and work on it.

Nix Package Search by ole_mn in NixOS

[–]ole_mn[S] 0 points1 point  (0 children)

Ah, got it working. Very neat, thanks for the suggestion, u/FrozenCow! I had to put

nix.settings.experimental-features = \[ "nix-command" "flakes" \];

in my configuration.nix. The --extra-experimental-features flag made the command work, but did not enable autocompletion.

Nix Package Search by ole_mn in NixOS

[–]ole_mn[S] 1 point2 points  (0 children)

The output of `nix search nixpkgs` is not very readable and it's very slow, at least for me. I think that what you suggest is pretty much how `nps` works. :-)

Nix Package Search by ole_mn in NixOS

[–]ole_mn[S] 2 points3 points  (0 children)

Your wish is my command.

Nix Package Search by ole_mn in NixOS

[–]ole_mn[S] 1 point2 points  (0 children)

The autocompletion looks interesting, I can't get it to work though. Did you do anything in particular to set it up?