Nix search nixpkgs

When i search something with nix search nixpkgs
So in nix search nixpkgs it says its legacypackages. İ dont want to see it. İ just want to see that it only types assaultcube how to do it?

$ nix search nixpkgs assaultcube 2>/dev/null| sed -e 's|legacy.*linux\.||'
* assaultcube (
  Fast and fun first-person-shooter based on the Cube fps

Or just live with it. Thats how we access things in a flake world anyway…

1 Like

I have to ask. This is the first time I’ve seen ‘|’ in sed expressions instead of ‘/’. What is the difference and why prefer pipe?

1 Like

It is just one of the possible delimiters, and I am used to them, as I often have slashes in my regexes and I want avoid escaping them.


The nix legacy world and nix flakes world are still somewhat distant from each other… Also, for a newcomer legacyPackages sounds quite misleading.

There is another problem with the modern nix search – it has lost the less pager that was enabled by default and worked well. Moreover, there is no concise way of enabling it, because a naive nix search nixpkgs clang | less prints a mixture:

evaluating 'legacyPackages.x86_64-linux.bear'* legacyPackages.x86_64-linux.bear (3.0.20)
evaluating 'legacyPackages.x86_64-linux.ccls'  Tool that generates a compilation database for clang tooling

* legacyPackages.x86_64-linux.ccls (0.20210330)
evaluating 'legacyPackages.x86_64-linux.clang-analyzer'  A c/c++ language server powered by clang

* legacyPackages.x86_64-linux.clang (11.1.0)
  A C language family frontend for LLVM (wrapper script)

evaluating 'legacyPackages.x86_64-linux.clang-analyzer'* legacyPackages.x86_64-linux.clang-analyzer (13.0.1)
evaluating 'legacyPackages.x86_64-linux.clang-manpages'  Clang Static Analyzer

* legacyPackages.x86_64-linux.clang-manpages (11.1.0)
  man page for Clang 11.1.0

From an end user perspective the lack of easy to type and read nix search is a big loss. Even for an experienced nix user like me (but who did not use flakes before).


legacyPackages does not mean that any packages in it are legacy, it is about the mixed semantic of libraries, packages, builders, fetchers, etc.

Though I agree that paging is hardly possible as there is always the progress “streamed”.

I really wish that the experimental commands would be more sensible to a TTY being available.


I wanna +1 that and add that I find it quite a bad idea to restructure the way tools are used when users are already used to them.
‘nix search’ now has a slightly changed syntax in comparison to before which gave the feeling of falling back down on the ultra steep learning curve nixos would already provide.

1 Like

It seems I’ve found the workaround for paging:

nix search nixpkgs | less -F

Somehow the -F option prevents the progress text from being interleaved with the actual output.
Ah, it is not entirely true - there are still some progress messages.

Still the best option is to redirect stderr:

nix search nixpkgs 2>/dev/null | less