From 3ba52b0d7ac66e1ed0bd7e94a5ce06ef04258da2 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Tue, 21 Jul 2026 08:09:05 -0500 Subject: [PATCH 1/2] luarocks-packages-updater: support initial maintainer Allow passing `--maintainers` to add the maintainers for a new package creation. --- doc/languages-frameworks/lua.section.md | 5 ++++- pkgs/by-name/lu/luarocks-packages-updater/updater.py | 9 ++++++++- .../src/nixpkgs_plugin_update/__init__.py | 4 ++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/doc/languages-frameworks/lua.section.md b/doc/languages-frameworks/lua.section.md index 97161970d8e4..f26ba801f8a1 100644 --- a/doc/languages-frameworks/lua.section.md +++ b/doc/languages-frameworks/lua.section.md @@ -167,9 +167,12 @@ To add a new package without updating all packages, run ```sh nix-shell -p luarocks-packages-updater -luarocks-packages-updater add +luarocks-packages-updater add [--maintainers ""] ``` +The optional `--maintainers` argument accepts a space-separated list of nixpkgs maintainer names. +When omitted, the package is added without maintainers. + [luarocks2nix](https://github.com/nix-community/luarocks) is a tool capable of generating nix derivations from both rockspec and src.rock (and favors the src.rock). The automation only goes so far though and some packages need to be customized. These customizations go in [pkgs/development/lua-modules/overrides.nix](https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/lua-modules/overrides.nix). diff --git a/pkgs/by-name/lu/luarocks-packages-updater/updater.py b/pkgs/by-name/lu/luarocks-packages-updater/updater.py index 80221bc6c75a..03b59098fda0 100755 --- a/pkgs/by-name/lu/luarocks-packages-updater/updater.py +++ b/pkgs/by-name/lu/luarocks-packages-updater/updater.py @@ -182,6 +182,13 @@ class LuaEditor(nixpkgs_plugin_update.Editor): parser.set_defaults(proc=1, update_only=None) return parser + def configure_add_parser(self, parser): + parser.add_argument( + "--maintainers", + default="", + help="Space-separated nixpkgs maintainer names to add to each package", + ) + def get_current_plugins(self, _config: FetchConfig, _nixpkgs: str): return [] @@ -340,7 +347,7 @@ class LuaEditor(nixpkgs_plugin_update.Editor): "server": "", "version": "", "luaversion": "", - "maintainers": "", + "maintainers": args.maintainers, } existing_entries.append(new_entry) diff --git a/pkgs/development/python-modules/nixpkgs-plugin-update/nixpkgs-plugin-update/src/nixpkgs_plugin_update/__init__.py b/pkgs/development/python-modules/nixpkgs-plugin-update/nixpkgs-plugin-update/src/nixpkgs_plugin_update/__init__.py index 612fa0823bdf..563d3294148b 100644 --- a/pkgs/development/python-modules/nixpkgs-plugin-update/nixpkgs-plugin-update/src/nixpkgs_plugin_update/__init__.py +++ b/pkgs/development/python-modules/nixpkgs-plugin-update/nixpkgs-plugin-update/src/nixpkgs_plugin_update/__init__.py @@ -1037,6 +1037,9 @@ class Editor: def rewrite_input(self, *args, **kwargs): return rewrite_input(*args, **kwargs) + def configure_add_parser(self, _parser: argparse.ArgumentParser) -> None: + """Add updater-specific arguments to the add subcommand.""" + def create_parser(self): common = argparse.ArgumentParser( add_help=False, @@ -1122,6 +1125,7 @@ class Editor: nargs="+", help=f"Plugin to add to {self.attr_path} from Github in the form owner/repo", ) + self.configure_add_parser(padd) pupdate = subparsers.add_parser( "update", From 652912633910050ccc5f9b2e7bf3986438df8b72 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Tue, 21 Jul 2026 08:15:40 -0500 Subject: [PATCH 2/2] luarocks-packages-updater: format updater Apply Ruff formatting to keep the updater source consistent. --- pkgs/by-name/lu/luarocks-packages-updater/updater.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/lu/luarocks-packages-updater/updater.py b/pkgs/by-name/lu/luarocks-packages-updater/updater.py index 03b59098fda0..e3e88e780701 100755 --- a/pkgs/by-name/lu/luarocks-packages-updater/updater.py +++ b/pkgs/by-name/lu/luarocks-packages-updater/updater.py @@ -72,7 +72,7 @@ LICENSE_NORMALIZATION = { "Apache 2.0": "lib.licenses.asl20", "Apache-2.0": "lib.licenses.asl20", "Apache License Version 2": "lib.licenses.asl20", - "BSD": "lib.licenses.free", # Too unspecific + "BSD": "lib.licenses.free", # Too unspecific "BSD-2-Clause": "lib.licenses.bsd2", "BSD-3-Clause": "lib.licenses.bsd3", "GPL-2+": "lib.licenses.gpl2Plus", @@ -85,7 +85,7 @@ LICENSE_NORMALIZATION = { "GPL-3.0-or-later": "lib.licenses.gpl3Plus", "GPLv3+ and other free licenses": "lib.licenses.AND [ lib.licenses.gpl3Plus lib.licenses.free ]", "ISC": "lib.licenses.isc", - "LGPL": "lib.licenses.free", # Too unspecific + "LGPL": "lib.licenses.free", # Too unspecific "LGPL-2.0": "lib.licenses.lgpl2Only", "LGPL-2.1": "lib.licenses.lgpl21Only", "LGPL-3.0": "lib.licenses.lgpl3Only", @@ -99,7 +99,7 @@ LICENSE_NORMALIZATION = { "2-clause BSD": "lib.licenses.bsd2", "Two-clause BSD": "lib.licenses.bsd2", "Public domain": "lib.licenses.publicDomain", - "UNKNOWN": "lib.licenses.unfree" + "UNKNOWN": "lib.licenses.unfree", } LICENSE_FULL_NAME_RE = re.compile(r'(?P\s*)license\.fullName = "(?P[^"]+)";') @@ -217,11 +217,7 @@ class LuaEditor(nixpkgs_plugin_update.Editor): specs = sorted(specs, key=lambda v: v.name.lower()) if args.update_only: - specs = [ - p - for p in specs - if p.normalized_name in args.update_only or p.name in args.update_only - ] + specs = [p for p in specs if p.normalized_name in args.update_only or p.name in args.update_only] if not specs: log.error("No matching Lua packages to update")