Skip to content

aliases: remove old throwing lua and writers aliases - #456468

Merged
wolfgangwalther merged 2 commits into
NixOS:masterfrom
qweered:aliases
Dec 3, 2025
Merged

wolfgangwalther merged 2 commits into
NixOS:masterfrom
qweered:aliases

Conversation

@qweered

@qweered qweered commented Oct 28, 2025

Copy link
Copy Markdown
Contributor

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.

@qweered

qweered commented Oct 28, 2025

Copy link
Copy Markdown
Contributor Author

@wolfgangwalther Idk if should we do something like this in preparation for by-name aliases migration

@wolfgangwalther wolfgangwalther left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Removing old aliases is great, moving stuff to the top-level won't work like that.

Comment thread pkgs/top-level/aliases.nix Resolved
@qweered qweered closed this Oct 28, 2025
@qweered
qweered deleted the aliases branch October 28, 2025 20:21
@wolfgangwalther

Copy link
Copy Markdown
Contributor

I think the first two commits were good.

@qweered
qweered restored the aliases branch November 30, 2025 00:22
@qweered qweered reopened this Nov 30, 2025
@qweered
qweered marked this pull request as ready for review November 30, 2025 00:23
@qweered qweered changed the title aliases: move some aliases to top level aliases: remove trowing lua and writers aliases Nov 30, 2025
@nixpkgs-ci nixpkgs-ci Bot added 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. 6.topic: lua Lua is a powerful, efficient, lightweight, embeddable scripting language. labels Nov 30, 2025
@qweered qweered changed the title aliases: remove trowing lua and writers aliases aliases: remove old throwing lua and writers aliases Nov 30, 2025
@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Nov 30, 2025
@nixpkgs-ci nixpkgs-ci Bot removed the 12.approvals: 1 This PR was reviewed and approved by one person. label Nov 30, 2025
@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 2 This PR was reviewed and approved by two persons. label Nov 30, 2025
@teto

teto commented Nov 30, 2025 •

Copy link
Copy Markdown
Member

I miss some context I think. Ok for removing old aliases but why remove the infra, is this part of a bigger cleanup

There is an existing pattern:

➜ fd aliases
maintainers/scripts/remove-old-aliases.py
pkgs/applications/editors/kakoune/plugins/aliases.nix
pkgs/applications/editors/vim/plugins/aliases.nix
pkgs/build-support/writers/aliases.nix
pkgs/by-name/km/kmod-debian-aliases/
pkgs/development/cuda-modules/aliases.nix
pkgs/development/lua-modules/aliases.nix
pkgs/development/node-packages/aliases.nix
pkgs/development/python-modules/click-aliases/
pkgs/top-level/aliases.nix
pkgs/top-level/darwin-aliases.nix
pkgs/top-level/python-aliases.nix

What's the recommended way to alias lua packages ?

@wolfgangwalther

Copy link
Copy Markdown
Contributor

Yeah, I guess this is a question of philosophy. Without any aliases - this would be dead code, because it's unused. Personally, I'm trying to prune dead code aggressively, we can still introduce it later if we need it.

@teto

teto commented Nov 30, 2025

Copy link
Copy Markdown
Member

keep one alias or create one if it's to please tooling. Clearly we will need aliases again so I would rather not have revert infra changes that might hinder the person adding the alias, trigger rereviewing and make it harder for everyone.
I dont care about the implementation but we need to keep the ability to add ones without a "core" maintainer having to step in.

@khaneliman

Copy link
Copy Markdown
Contributor

keep one alias or create one if it's to please tooling. Clearly we will need aliases again so I would rather not have revert infra changes that might hinder the person adding the alias, trigger rereviewing and make it harder for everyone.

I dont care about the implementation but we need to keep the ability to add ones without a "core" maintainer having to step in.

Yeah I agree actually. Was one of the reasons I was hesitant to merge right away.

@7c6f434c

7c6f434c commented Dec 2, 2025

Copy link
Copy Markdown
Member

Indeed, wiping the obviously to-be-needed-again-soon supporting code is unreasonable.

@wolfgangwalther

Copy link
Copy Markdown
Contributor

That "supporting code" was neither needed before, nor will it "obviously" be needed again. With the frequency of aliases added for lua-modules over the years (6 aliases in 3+ years...), it is entirely thinkable that this just won't matter anymore the next time an alias needs to be added. Also note that this "infrastructure" has been copied from node-packages.nix (there are even still references to node-packages.nix and its remove-attrs.py script...), which likely had to deal with a lot more aliases, at least in the past.

Adding new aliases will be as easy as adding a lib.optionalAttrs config.allowAliases { aliases = throw "abc"; } in the right place - the same way it is done in many other places across the tree. No need for this overly complicated stuff.

@teto

teto commented Dec 2, 2025

Copy link
Copy Markdown
Member

yes it was copied from node-packages so I understand the need for deduplication.
The number of aliases is not a good metric, you just need one. The lua ecosystem in nixpkgs is not very mature yet, and lua packages ("rockspec") were not that popular but it's seeing renewed interested due to software like roblox/neovim/rocks.nvim so we can expect more aliases.

lib.optionalAttrs config.allowAliases { aliases = throw "abc"; }

I was not familiar with that pattern but it's enough for me to approve this PR. I believe some scripts exist to get rid of old aliases. Does this mean we should keep those aliases in a separate file to help that script ? in which case we might want to keep lua-modules/aliases.nix

@wolfgangwalther

Copy link
Copy Markdown
Contributor

I believe some scripts exist to get rid of old aliases. Does this mean we should keep those aliases in a separate file to help that script ? in which case we might want to keep lua-modules/aliases.nix

Well, these scripts have never been run, so it's not like we would be breaking anything in practice. We did run them recently, but if everything works out fine, this might have been the last time to do so. The intent is to implement "structured aliases" which would automate the removal without such scripts - and in that case, all the infrastructure here would go away anyway.

it's enough for me to approve this PR

OK, will merge, thanks!

@wolfgangwalther
wolfgangwalther added this pull request to the merge queue Dec 3, 2025
Merged via the queue into NixOS:master with commit 960c79b Dec 3, 2025
@qweered
qweered deleted the aliases branch December 3, 2025 23:02
@mrcjkb mrcjkb mentioned this pull request Aug 3, 2026
2 of 13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: lua Lua is a powerful, efficient, lightweight, embeddable scripting language. 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: 2 This PR was reviewed and approved by two persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants