wamserma / flake-programs-sqlite

A simple flake to automagically specify programs.sqlite for command-not-found.
https://discourse.nixos.org/t/27669
MIT License
34 stars 0 forks source link

support programs from inputs beyond nixpkgs #23

Closed KiaraGrouwstra closed 7 months ago

KiaraGrouwstra commented 7 months ago

right now flake-programs-sqlite helps suggest installing programs based on packages in nixpkgs. however, nix users may well source packages from other sources, among which e.g. NUR. it would be cool if we could somehow generalize the approach here such as to incorporate suggestions dynamically based on a user's system flake and such additional inputs providing packages.

e.g. this currently works:

$ htop
The program 'htop' is not in your PATH. It is provided by several packages.
You can make it available in an ephemeral shell by typing one of the following:
  nix-shell -p htop
  nix-shell -p htop-vim

while this does not:

$ kazv
kazv: command not found
wamserma commented 7 months ago

Thank you for your feature request. However, this capability is beyond the scope of flake-programs-sqlite.

The suggestions are generated by https://github.com/NixOS/nixpkgs/blob/7c44c865ee736afba33ee8788b59e4a123800437/nixos/modules/programs/command-not-found/command-not-found.pl, which is part of nixpkgs. See the Why/How-Sections of the Readme in this repo for details. There is no programs.sqlite for NUR or other repos that flake-programs-sqlite could track, neither would those be consumed by the command-not-found-script.