The nix
tool has changed quite a bit from 21.11 to 22.05, and I haven’t found any documentation on how to do the same things I could previously. I’ve worked out stuff like:
-
nix eval
now needs --expr
, and often needs --impure
-
nix edit nixos.hello
is now nix edit -f "<nixpkgs>" hello
- similarly,
nix run nixos.hello -c hello
is now nix run -f "<nixpkgs>" hello
(with extra arguments after a --
)
but I can’t tell how I’m meant to use nix search
now without switching entirely to a flake-based system. The obvious thing seems to work initially:
$ nix search -f "<nixpkgs>" hello
* (2.12)
A program that produces a familiar, friendly greeting
but that doesn’t actually search for “hello”, it just prints out the hello
nixpkgs attribute. So I tried <nixpkgs/nixos>
and the pkgs
attribute, but it seems to want to evaluate the entire attrset before doing anything:
$ nix search -f "<nixpkgs/nixos>" pkgs hello
error: Please be informed that this pseudo-package is not the only part of
Nixpkgs that fails to evaluate. You should not evaluate entire Nixpkgs
without some special measures to handle failing packages, like those taken
by Hydra.
which obviously doesn’t work.
How am I meant to search for packages on NixOS 22.05, apart from search.nixos.org (which, incidentally, still lists 22.05 as “beta”)?