Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow filtering out results from FHS packages #233

Open
athre0z opened this issue Sep 3, 2023 · 3 comments
Open

Allow filtering out results from FHS packages #233

athre0z opened this issue Sep 3, 2023 · 3 comments

Comments

@athre0z
Copy link

athre0z commented Sep 3, 2023

There's a bunch of FHS packages in nixpkgs that essentially ship half a distro with them and massively pollute the output when searching for packages that provides common command line tools. For example I just wanted to locate the package that provides fsck.ext4 and more than 60 FHS packages matched, many of them somehow having fsck.ext4 in 4 different places within the package (some symlink foo, probably).

It takes quite a few seconds to locate the actually relevant e2fsprogs.bin line between the 240 lines of noise from FHS packages. This is not really specific to fsck.ext4 and I run into this problem quite frequently.

I think it'd make a lot of sense to automatically detect and tag these FHS packages, perhaps during the indexing phase, and to allow filtering them out with a option passed to nix-locate. Most of them seem to have a -fhs / -usr-target suffix somewhere in the paths, so it should hopefully be easy to detect them based on that. It might even make sense to invert that option, filtering out the FHS packages by default, but it'd be a rather breaking chance.

@jwdevantier
Copy link

Seconded, nix-locate is basically useless as-is

@doronbehar
Copy link
Contributor

This can be fixed by merging #243 .

@Ma27
Copy link
Member

Ma27 commented Jul 25, 2024

Adding --top-level should be sufficient to solve your problem. But I agree that it's a bit annoying since this should be the default. That's what #243 is for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants