nixos-search
nixos-search copied to clipboard
Commands ignoring channel
The displayed commands ignore the selected channel.

But Nix is broken and nix-shell '<nixos-unstable> -p hello uses stable channel (https://github.com/NixOS/nix/issues/6984)!
What do you suggest? Adding -I nixpkgs=channel:nixos-<channel> to the command line?
This is a complicated UX design problem.
Most users probably only look up the package name and command to use with their default channel (e.g. nixos stable). Then the current command is fine.
Another use case is when a user intentionally set a different channel (as i did here) and expect to use that. Then it has to be added to the command.
nix-shell -I nixpkgs=channel:nixos-unstable -p hello
It will become even more complicated for configuration.nix.
This shows again how complicated Nix is. There are 12* different official ways to install a package. Even more with third-party tools like home-manager, snow and nix-software-center. No surprise users give up.
*3 supported channels * 4 install methods (nix-shell, nix-env, environment.systemPackages, users.users.
I've said this before but I don't think nixos-search should spoonfeed users or teach them how to use Nix. The "How to install" section is meant as a quick reminder if you're not sure which name is the attribute name or you just want something to quickly copy-and-paste, but it shouldn't try to cover every possible scenario. Users should be able to fill in the gaps if they want something more specific.