Types of package duplication in `nix search`

Similarly to this other topic and another one with more info, I stumbled upon a github issue in which the user was finding several duplicates in their nix-search results. Now, the topics only refer to channel duplication, and appear to have a clue on why it might be. For the original issue opener, I’d suggest reading that second topic and testing along to see what we can find.

However, that part I can’t help with because a) It’s been more than a year since I last had nix search return any result at all, and b) it would probably require messing with nix itself. In the issue I propose a different output for the search results, but I realise that can be hard and finnicky.

If you search for certain packages, you’re bound to find the default and their unwrapped versions. Apparently (or at least in lutris’ case) only the unwrapped version gets a description.

I can’t really test because, as I said, my nix search has been borked since forever, I’d hope something in my config breaks it because recent installs are like this and my config is shared. But I’d like to know if this can be better handled:

  • Could we have a description per variant? I mean technically, I wouldn’t be surprised if the way we handle descriptions in derivations meant only the “main” package gets the only associated shortdesc and the rest can’t have one. Lutris has suffix-less, -free and -unwrapped entries: maybe they could each have their description include what’s its particularity? Or at least, append to the main desc or something.
  • Can nix search be taught to, instead of showing -unwrapped variants as top-level packages (which I know is technically true), just mark the related “wrapped” entry as being wrapped, and hide -unwrapped? I’d guess raw usage of the unwrapped variant is uncommon, and you’d be expected to know what it is before using it, so a mark on the main entry could suffice?

Excuse me for being lazy in my response but you should read: Use only 1 channel for my user's `nix-env` and root's `nixos-rebuild` - #5 by danbst

The UX for nix search is a little weird - it just ends up listing all top-level derivations. I think it would be useful to group variants together in some way, although we will probably need an RFC to coordinate between Nix and Nixpkgs. At the very least we should have some policy to have unique names and descriptions for each top-level drv - right now lots of the wrappers just reuse the same description.

Another related topic is that we have a bunch of “aliases” in Nixpkgs that get listed multiple times. It would be nice to have a way to mark these as dupes (Packages with aliases appear multiple times in ```nix-env -qa``` · Issue #2113 · NixOS/nix · GitHub).

That’s not confusing at all! :smiley:

Without reading the thread in depth, it seems like the NIX_PATH variable
is just not much fun to work with :frowning:

At least I gather it is possible. I also guess this is far from a
priority right now.