Non-transitional aliases (redirects?) in Nixpkgs

Nixpkgs has the concept of aliases, which are intended to be transitional; they get an added-on date attached to them and eventually they’re replaced with a throw, as far as I can tell. This is neat because these can be disabled if an automated process is looking through the list of all packages and doesn’t want duplicates.

There are also cases in all-packages.nix where a particular package version is ‘aliased’ to a version-less name, like bestappever = bestappever9;. These are less neat for automated processes because they can’t be disabled or filtered out. But they aren’t transitional in the same way that the things in aliases.nix are.

Can we consider marking these somehow so that automated processes can filter them out? I’m imagining a new meta or passthru property, along with a lib.mkRedirect function that would be used in all-packages.nix to set it (and preserve everything else about the package). (I don’t know which, if either, of those namespaces would change the Nix derivation hash, which would be undesirable.)

Would this conflict with anything being planned for the new pkgs/by-name organizational structure?

1 Like

This may also be relevant for, though it basically has the inverse problem: Treat alias names like description · Issue #345 · NixOS/nixos-search · GitHub

Indeed such aliases are not great. It’s something I’'ve been eyeing to improve as part of a general re-organisation of different package variants, but nothing concrete so far.

And indeed pkgs/by-name could tie into that, though for now you can’t define aliases there.

If you’re interested in diving deeper yourself with a more concrete proposal, the Nixpkgs Architecture Team could give feedback :slight_smile: