mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-24 01:21:11 +00:00
luarocks-packages-updater: support initial maintainer
Allow passing `--maintainers` to add the maintainers for a new package creation.
This commit is contained in:
@@ -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 <package-name>
|
||||
luarocks-packages-updater add [--maintainers "<maintainer>"] <package-name>
|
||||
```
|
||||
|
||||
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).
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user