nixos-search icon indicating copy to clipboard operation
nixos-search copied to clipboard

Commands ignoring channel

Open davidak opened this issue 2 years ago • 3 comments

The displayed commands ignore the selected channel.

Screenshot from 2022-11-21 08-11-57

But Nix is broken and nix-shell '<nixos-unstable> -p hello uses stable channel (https://github.com/NixOS/nix/issues/6984)!

davidak avatar Nov 21 '22 07:11 davidak

What do you suggest? Adding -I nixpkgs=channel:nixos-<channel> to the command line?

ncfavier avatar Jan 27 '23 18:01 ncfavier

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..packages)

davidak avatar Jun 25 '23 19:06 davidak

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.

ncfavier avatar Jun 25 '23 20:06 ncfavier