I see. So lets fix -f there.
I spent several hours looking into this and here’s what I figured (not much):
-
In
nix search -f expr arg1 arg2
arg1 is always interpreted as an “installable”, which with-f
means an attribute path ofexpr
. So, innix search -f expr arg1
,arg1
is not the search string but an attribute path, hence the error. -
In
nix search -f'<nixpkgs>'
the “installable” defaults to"."
but it’s parsed incorrectly:installable->getCursors(*state)
, which I suspect should return a pointer to some kind of tree (there’s hardly any comment in the nix codebase), produces theerror: '' is not an attribute set
This happens before any of the search/traversal logic of
nix search
, but that’s as far as I can get. -
There’s no syntax to refer to the top-level that nix seems to understand, but subsets work (somewhat, see the error at the end):
$ nix search -f '<nixpkgs>' xorg bit * bitmap (1.0.9) * fontbitstream100dpi (100dpi-1.0.3) * fontbitstream75dpi (75dpi-1.0.3) * fontbitstreamtype1 (1.0.3) error: 'packages' is not an attribute set
I guess this explain why the UI is so poor: unlike for Nixpkgs there’s only a dozen people that understand Nix and can fix it.