nixos-manager icon indicating copy to clipboard operation
nixos-manager copied to clipboard

Search for packages with a specific file (via nix-index/nix-locate)

Open evanjs opened this issue 4 years ago • 1 comments

Perhaps the package search (or a separate search window) could defer to something like nix-locate (via nix-index) to allow users to search for packages containing a specific file.

I imagine this could be like a frontend for nix-locate, allowing users to utilize the nixos-manager GUI and skip any terminal commands, as nix-locate results can often be quite overwhelming, especially if --top-level or similar flags are neglected.


e.g. command: nix-locate glib-2.0.so -w1 --top-level

output:

spice-gtk.out
signal-desktop.out
glib.out

nix-index must be run before nix-locate, and I'm not sure how or if that would need to be implemented--vs simply telling the user they must run it first to utilize such features--but I figure such a feature would be quite helpful and not too difficult to implement... should it be deferred to something that already handles such indexing/searching, or at least the indexing.

evanjs avatar Apr 18 '20 19:04 evanjs

Interesting. I didn't even know about nix-locate or nix-index, though I'm actually using command-not-found.sh regularly. :)

It'd be great to augment the search feature so it doesn't just search by package name (or description) in order to get more results (though the package name should be enough for most use cases, I hope). One could also imagine a more intelligent search string, where you might type something "foobar:inpackage" to specifically search using the nix-locate data base.

I'm going to leave this open and think about it some more at a later point in time (or give somebody else the chance to implement it).

Thanks for the suggestion anyway!

pmiddend avatar Apr 21 '20 09:04 pmiddend