Skip to content

aliases: clean up#456065

Merged
wolfgangwalther merged 15 commits intoNixOS:masterfrom
emilazy:push-lpkmnukxqspk
Oct 28, 2025
Merged

aliases: clean up#456065
wolfgangwalther merged 15 commits intoNixOS:masterfrom
emilazy:push-lpkmnukxqspk

Conversation

@emilazy
Copy link
Member

@emilazy emilazy commented Oct 27, 2025

Based on @pbsds and @mdaniels5757’s work on the script in #427017, with some manual work on top as described in #427017 (review). Hopefully this is the last time we have to do this before structured aliases are a thing!

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 2.status: merge conflict This PR has merge conflicts with the target branch 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Oct 27, 2025
@qweered
Copy link
Contributor

qweered commented Oct 27, 2025

I think we can change comments from dates to releases, like "Added in 25.05" and enforce it so it will be easier to migrate later

@emilazy
Copy link
Member Author

emilazy commented Oct 27, 2025

Yeah, that would be better, but with #442066 on the horizon I’m not personally invested in making significant changes here – just don’t want to have to migrate thousands of ancient aliases to by-name in 26.05.

@wolfgangwalther
Copy link
Contributor

Rebased this after merging #427017, solving a merge conflict that had already appeared along the way.

@nixpkgs-ci nixpkgs-ci bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Oct 27, 2025
Copy link
Contributor

@wolfgangwalther wolfgangwalther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously, I did not check every single change - but I went through every commit and I approve the intent / approach.

@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Oct 27, 2025
@emilazy emilazy marked this pull request as ready for review October 27, 2025 18:41
@emilazy
Copy link
Member Author

emilazy commented Oct 27, 2025

I’ve dropped the commit to add warnings to aliases that are new in 25.11, since that has the usual awkwardness relating to the overlapping support periods of unstable, stable, and oldstable.

The only remaining decision is whether we want to go through a warning period for the long history of aliases from 25.05 and prior, or whether we’re okay making them throw immediately. I favour going straight to throws, because the replacements are already available in all supported versions, and it will result in much less churn when migrating things to structured aliases. We do already often add similar renames as throws from the get go. With structured aliases we’ll get an automatic transition through silent, warning, throw, and removal, so we won’t build up as big a backlog over time.

@emilazy emilazy force-pushed the push-lpkmnukxqspk branch 2 times, most recently from 1f7ae96 to 4530faf Compare October 27, 2025 18:49
@wolfgangwalther
Copy link
Contributor

I'm all in favor of making these old aliases throws immediately: It's great that we have ideas for a fully automated workflow, it's great that we have scripts to theoretically do these transition periods right now as well - but in practice we didn't have that, so far. Just because we have an idea of "a warning should be better before a throw" doesn't mean we actually established that in practice. Thus, it's entirely fine to get rid of all the cruft now to get to a rather clean slate from which we can do better in the future.

@qweered
Copy link
Contributor

qweered commented Oct 27, 2025

I am worried that drop of so many aliases without throw or warning will immediately affect many users and there is no easy way to find what is replacement for each alias, only looking at this pr diff. With warning replacement is clear and gives users time

@emilazy
Copy link
Member Author

emilazy commented Oct 27, 2025

This PR does not drop any aliases that were not already throws in the 25.05 release tag.

@wolfgangwalther
Copy link
Contributor

Rebased to resolve merge conflict (simple addition of another throwing alias)

@wolfgangwalther
Copy link
Contributor

Thank you, great work!

@wolfgangwalther wolfgangwalther added this pull request to the merge queue Oct 28, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Oct 28, 2025
This previously merged in `self`, so the flattened attribute set was
not quite correct, but it’s ancient anyway.
phip1611 added a commit to phip1611/nixos-configs that referenced this pull request Oct 29, 2025
phip1611 added a commit to phip1611/nixos-configs that referenced this pull request Oct 29, 2025
bachp added a commit to bachp/nixpkgs that referenced this pull request Oct 29, 2025
Adapt the module to the changes introduced in NixOS#456065
jetjinser added a commit to jetjinser/nixos-unified that referenced this pull request Oct 30, 2025
sigprof added a commit to sigprof/nur-packages that referenced this pull request Oct 30, 2025
`wrapGAppsHook` was renamed to `wrapGAppsHook3` in NixOS/nixpkgs#307077
(available since NixOS 24.05), and since NixOS/nixpkgs#456065 the old
name no longer works.  Update the old virt-manager package accordingly.
jetjinser added a commit to jetjinser/flake that referenced this pull request Oct 30, 2025
vaapiVdpau = libva-vdpau-driver; # Added 2024-06-05
validphys2 = throw "validphys2 has been removed, since it has a broken dependency that was removed"; # Added 2024-08-21
util-linuxCurses = throw "'util-linuxCurses' has been renamed to/replaced by 'util-linux'"; # Converted to throw 2025-10-27
utillinux = throw "'utillinux' has been renamed to/replaced by 'util-linux'"; # Converted to throw 2025-10-27
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit message on cede056 asserts that “This was fixed upstream in node2nix in 2020”, but it’s wrong: node2nix incorrectly prefers utillinux over util-linux, and therefore hits this throw.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right… Sorry about this. It has been reverted to a warning in #456527.

FWIW I would recommend moving off node2nix as it is unmaintained and we have better alternatives these days; we are steadily removing things from our nodePackages set that used it. I expect it will simply break when this becomes a throw next release.

@sternenseemann
Copy link
Member

The removal of the emacsPackages alias should be reverted since all emacs packages will show up as emacsPackages.<foo> in search.nixos.org. This is due to limitations in how the indexer works, it can't really be told to index a passthru attribute of a derivation at the moment. C.f.:

# emacsPackages is an alias for emacs.pkgs
# Re-introduce emacsPackages here so that emacs.pkgs can be searched.
emacsPackages = emacs.pkgs;

@wolfgangwalther
Copy link
Contributor

The removal of the emacsPackages alias should be reverted

Right, PR in #457521.

tvlbot pushed a commit to wpcarro/struct.el that referenced this pull request Nov 1, 2025
Almost all these expressions already depend on depot. This is most
notably the case for all expressions that are exported to
github.com/wpcarro, so the current implementation of the package builds
does not actually allow Nix builds independently from depot.

Currently, they somewhat clumsily replicate the API of buildEmacsPackage
so they can be used with depot. This unfortunately introduces a hard
dependency on the emacsPackages alias in Nixpkgs which has been removed
recently (see [also]). To deal with this, we may want to change the
internal API of buildEmacsPackage or implement a shim. This is much
easier to do when it only needs to happen in a single, central place.

While I was at it, I moved all test suites into installCheckPhase which
just requires -f package-activate-all instead of building a separate
version of the package and a emacsWithPackages derivation.

We can also change passthru.meta to meta without any problems.

[also]: NixOS/nixpkgs#456065 (comment)

Change-Id: Ic91766ee8f88f1786679f8d0bedc4bf7456f299c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/13814
Autosubmit: sterni <[email protected]>
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <[email protected]>
Reviewed-by: sterni <[email protected]>
tvlbot pushed a commit to wpcarro/cycle.el that referenced this pull request Nov 1, 2025
Almost all these expressions already depend on depot. This is most
notably the case for all expressions that are exported to
github.com/wpcarro, so the current implementation of the package builds
does not actually allow Nix builds independently from depot.

Currently, they somewhat clumsily replicate the API of buildEmacsPackage
so they can be used with depot. This unfortunately introduces a hard
dependency on the emacsPackages alias in Nixpkgs which has been removed
recently (see [also]). To deal with this, we may want to change the
internal API of buildEmacsPackage or implement a shim. This is much
easier to do when it only needs to happen in a single, central place.

While I was at it, I moved all test suites into installCheckPhase which
just requires -f package-activate-all instead of building a separate
version of the package and a emacsWithPackages derivation.

We can also change passthru.meta to meta without any problems.

[also]: NixOS/nixpkgs#456065 (comment)

Change-Id: Ic91766ee8f88f1786679f8d0bedc4bf7456f299c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/13814
Autosubmit: sterni <[email protected]>
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <[email protected]>
Reviewed-by: sterni <[email protected]>
tvlbot pushed a commit to wpcarro/vterm-mgt.el that referenced this pull request Nov 1, 2025
Almost all these expressions already depend on depot. This is most
notably the case for all expressions that are exported to
github.com/wpcarro, so the current implementation of the package builds
does not actually allow Nix builds independently from depot.

Currently, they somewhat clumsily replicate the API of buildEmacsPackage
so they can be used with depot. This unfortunately introduces a hard
dependency on the emacsPackages alias in Nixpkgs which has been removed
recently (see [also]). To deal with this, we may want to change the
internal API of buildEmacsPackage or implement a shim. This is much
easier to do when it only needs to happen in a single, central place.

While I was at it, I moved all test suites into installCheckPhase which
just requires -f package-activate-all instead of building a separate
version of the package and a emacsWithPackages derivation.

We can also change passthru.meta to meta without any problems.

[also]: NixOS/nixpkgs#456065 (comment)

Change-Id: Ic91766ee8f88f1786679f8d0bedc4bf7456f299c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/13814
Autosubmit: sterni <[email protected]>
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <[email protected]>
Reviewed-by: sterni <[email protected]>
@chillcicada chillcicada mentioned this pull request Nov 4, 2025
13 tasks
@dev-null-undefined
Copy link
Contributor

Whyyy??? Who does this help?

@MattSturgeon
Copy link
Contributor

Whyyy??? Who does this help?

Cleaning up old cruft helps simplify the codebase. The alternative is to keep aliases forever, which usually isn't what we want.


That said, I came here because several aliases I was using went straight from silent aliases to throws. I expected an intermediate stage, where aliases would warn (or warnOnInstantiate) for a release (or so) before eventually switching to throw.
E.g. firefox-wayland, noto-fonts-extra, etc

Am I wrong to assume that deprecated aliases should usually warn for a while before they start throwing?

Am I wrong to assume that aliases that don't warn1 are implicitly not deprecated (yet)?

Footnotes

  1. Or a warning conditional on oldestSupportedReleaseIsAtLeast.

@wolfgangwalther
Copy link
Contributor

Am I wrong to assume that deprecated aliases should usually warn for a while before they start throwing?

This is an idea that has, unfortunately, never been fully implemented and lived in practice. We want this to happen in the future, in a structured way, that codifies those expectations. A very early draft is in #442066.

Unfortunately, because nobody ever ran the related scripts over years, this didn't happen.

Am I wrong to assume that aliases that don't warn1 are implicitly not deprecated (yet)?

They'd already not be available for users running with allowAliases = false. They're already not referenced inside nixpkgs. The intent to deprecate has been made very clear by putting them into aliases.nix. We can consider them deprecated.

Note that this only affects aliases that can be changed to their replacement in all supported NixOS versions, so even for downstream projects, the adjustment should be very simple.

@MattSturgeon
Copy link
Contributor

MattSturgeon commented Nov 8, 2025

Am I wrong to assume that aliases that don't warn1 are implicitly not deprecated (yet)?

They'd already not be available for users running with allowAliases = false. They're already not referenced inside nixpkgs. The intent to deprecate has been made very clear by putting them into aliases.nix. We can consider them deprecated.

Hm, I'd always considered that aliases.nix includes both deprecated and non-deprecated aliases. A possible example being emacsPackages, mentioned above.

To me, gating something behind allowAliases means it can't be used internally, but can be used by out-of-tree users. If it implied deprecation, I would expect the option to be named allowDeprecated. And I would expect more thought to be put into warnings.

I've always treated allowAliases as an internal feature, meant to ensure that nixpkgs itself doesn't accidentally use aliases. Not something that end-users should typically enable.

If I wanted to add a second name for something, I would use aliases.nix even if I didn't want the alternative name to be considered deprecated -- unless the alternative name needed to be used internally within nixpkgs, of course. Perhaps this is incorrect?

very early draft is in #442066.

Thanks, I'll take a look when I have time ❤️

github-merge-queue bot pushed a commit that referenced this pull request Nov 13, 2025
This broke as of #456065.  krb5Full rename started way back in 2022
with #201707, and I guess ipa.nix was overlooked.
ysndr added a commit to flox/flox that referenced this pull request Dec 28, 2025
The former is in fact an alias of `runCommand`.
Many of these aliases are being phased out
and dropped in a future release of nixpkgs.

See: <NixOS/nixpkgs#456065>

Aliases are going to be replaced by a more automated/structural approach,
but that is orthogonal to the deprecation.
ysndr added a commit to flox/flox that referenced this pull request Dec 30, 2025
The former is in fact an alias of `runCommand`.
Many of these aliases are being phased out
and dropped in a future release of nixpkgs.

See: <NixOS/nixpkgs#456065>

Aliases are going to be replaced by a more automated/structural approach,
but that is orthogonal to the deprecation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants