nix-index
nix-index copied to clipboard
Allow filtering out results from FHS packages
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.
Seconded, nix-locate is basically useless as-is
This can be fixed by merging #243 .
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.