replit / rippkgs

A CLI for indexing and searching packages in Nix expressions
MIT License
153 stars 2 forks source link

Feature request: `command-not-found` implementation #29

Open jlbribeiro opened 7 months ago

jlbribeiro commented 7 months ago

First of all, thank you @replit for creating rippkgs and releasing it as an open-source project :)

In your release blog post, it is mentioned that "you’ve incorporated rippkgs into your command-not-found hook".

Given the scope of rippkgs (and the comparison to nix-index), would it be possible to provide a minimal command-not-found handler implementation that makes use of rippkgs (assuming Replit's implementation is too specific to be shared)?

This would be very useful to users of Nixpkgs/devShells in general, but particularly to NixOS users in flake-only (i.e. no channels) configurations [1], who usually resort to nix-index or a custom programs.command-not-found.dbPath [2].

Once again, thank you for rippkgs!

cdmistman commented 6 months ago

would love to share our command not found implementation! Is it enough to add documentation for this? I'd rather avoid adding the extra nix-index flake input if possible...

jlbribeiro commented 6 months ago

@cdmistman First of all, thank you for being open to that :)

To be honest, I didn't imagine it would depend on nix-index, because I thought rippkgs was a complete replacement of nix-index (although I admittedly don't fully grasp the implementation details to understand how they can complement each other). This request (along with #30) was basically an attempt at mimicking the "ergonomics" of nix-index as a command-not-found, since I envisioned rippkgs almost being a drop-in replacement, one NixOS/Home Manager module option away.

Being in documentation is already a great improvement, which would allow building all the other things upon it (maybe externally, if they don't fit this repo). So please do share :)