···134134135135Luarocks-based packages are generated in [pkgs/development/lua-modules/generated-packages.nix](https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/lua-modules/generated-packages.nix) from
136136the whitelist maintainers/scripts/luarocks-packages.csv and updated by running
137137-the script
138138-[maintainers/scripts/update-luarocks-packages](https://github.com/NixOS/nixpkgs/tree/master/maintainers/scripts/update-luarocks-packages):
137137+the package `luarocks-packages-updater`:
139138140139```sh
141141-./maintainers/scripts/update-luarocks-packages update
140140+141141+nix-shell -p luarocks-packages-updater --run luarocks-packages-updater
142142```
143143144144[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).
+12-3
maintainers/scripts/pluginupdate.py
···468468 "--input-names",
469469 "-i",
470470 dest="input_file",
471471+ type=Path,
471472 default=self.default_in,
472473 help="A list of plugins in the form owner/repo",
473474 )
···476477 "-o",
477478 dest="outfile",
478479 default=self.default_out,
480480+ type=Path,
479481 help="Filename to save generated nix code",
480482 )
481483 common.add_argument(
···787789788790 if autocommit:
789791 from datetime import date
790790- editor.nixpkgs_repo = git.Repo(editor.root, search_parent_directories=True)
791791- updated = date.today().strftime('%m-%d-%Y')
792792793793- commit(editor.nixpkgs_repo, f"{editor.attr_path}: updated the {updated}", [args.outfile])
793793+ try:
794794+ repo = git.Repo(os.getcwd())
795795+ updated = date.today().strftime('%m-%d-%Y')
796796+ print(args.outfile)
797797+ commit(repo,
798798+ f"{editor.attr_path}: updated the {updated}", [args.outfile]
799799+ )
800800+ except git.InvalidGitRepositoryError as e:
801801+ print(f"Not in a git repository: {e}", file=sys.stderr)
802802+ sys.exit(1)
794803795804 if redirects:
796805 update()
-224
maintainers/scripts/update-luarocks-packages
···11-#!/usr/bin/env nix-shell
22-#!nix-shell update-luarocks-shell.nix -i python3
33-44-# format:
55-# $ nix run nixpkgs#python3Packages.black -- update.py
66-# type-check:
77-# $ nix run nixpkgs#python3Packages.mypy -- update.py
88-# linted:
99-# $ nix run nixpkgs#python3Packages.flake8 -- --ignore E501,E265,E402 update.py
1010-1111-import inspect
1212-import os
1313-import tempfile
1414-import shutil
1515-from dataclasses import dataclass
1616-import subprocess
1717-import csv
1818-import logging
1919-import textwrap
2020-from multiprocessing.dummy import Pool
2121-2222-from typing import List, Tuple, Optional
2323-from pathlib import Path
2424-2525-log = logging.getLogger()
2626-log.addHandler(logging.StreamHandler())
2727-2828-ROOT = Path(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))).parent.parent # type: ignore
2929-import pluginupdate
3030-from pluginupdate import update_plugins, FetchConfig, CleanEnvironment
3131-3232-PKG_LIST = "maintainers/scripts/luarocks-packages.csv"
3333-TMP_FILE = "$(mktemp)"
3434-GENERATED_NIXFILE = "pkgs/development/lua-modules/generated-packages.nix"
3535-LUAROCKS_CONFIG = "maintainers/scripts/luarocks-config.lua"
3636-3737-HEADER = """/* {GENERATED_NIXFILE} is an auto-generated file -- DO NOT EDIT!
3838-Regenerate it with:
3939-nixpkgs$ ./maintainers/scripts/update-luarocks-packages
4040-4141-You can customize the generated packages in pkgs/development/lua-modules/overrides.nix
4242-*/
4343-""".format(
4444- GENERATED_NIXFILE=GENERATED_NIXFILE
4545-)
4646-4747-FOOTER = """
4848-}
4949-/* GENERATED - do not edit this file */
5050-"""
5151-5252-5353-@dataclass
5454-class LuaPlugin:
5555- name: str
5656- """Name of the plugin, as seen on luarocks.org"""
5757- src: str
5858- """address to the git repository"""
5959- ref: Optional[str]
6060- """git reference (branch name/tag)"""
6161- version: Optional[str]
6262- """Set it to pin a package """
6363- server: Optional[str]
6464- """luarocks.org registers packages under different manifests.
6565- Its value can be 'http://luarocks.org/dev'
6666- """
6767- luaversion: Optional[str]
6868- """Attribue of the lua interpreter if a package is available only for a specific lua version"""
6969- maintainers: Optional[str]
7070- """ Optional string listing maintainers separated by spaces"""
7171-7272- @property
7373- def normalized_name(self) -> str:
7474- return self.name.replace(".", "-")
7575-7676-7777-# rename Editor to LangUpdate/ EcosystemUpdater
7878-class LuaEditor(pluginupdate.Editor):
7979- def get_current_plugins(self):
8080- return []
8181-8282- def load_plugin_spec(self, input_file) -> List[LuaPlugin]:
8383- luaPackages = []
8484- csvfilename = input_file
8585- log.info("Loading package descriptions from %s", csvfilename)
8686-8787- with open(csvfilename, newline="") as csvfile:
8888- reader = csv.DictReader(
8989- csvfile,
9090- )
9191- for row in reader:
9292- # name,server,version,luaversion,maintainers
9393- plugin = LuaPlugin(**row)
9494- luaPackages.append(plugin)
9595- return luaPackages
9696-9797- def update(self, args):
9898- update_plugins(self, args)
9999-100100- def generate_nix(self, results: List[Tuple[LuaPlugin, str]], outfilename: str):
101101- with tempfile.NamedTemporaryFile("w+") as f:
102102- f.write(HEADER)
103103- header2 = textwrap.dedent(
104104- # header2 = inspect.cleandoc(
105105- """
106106- { stdenv, lib, fetchurl, fetchgit, callPackage, ... }:
107107- final: prev:
108108- {
109109- """
110110- )
111111- f.write(header2)
112112- for plugin, nix_expr in results:
113113- f.write(f"{plugin.normalized_name} = {nix_expr}")
114114- f.write(FOOTER)
115115- f.flush()
116116-117117- # if everything went fine, move the generated file to its destination
118118- # using copy since move doesn't work across disks
119119- shutil.copy(f.name, outfilename)
120120-121121- print(f"updated {outfilename}")
122122-123123- @property
124124- def attr_path(self):
125125- return "luaPackages"
126126-127127- def get_update(self, input_file: str, outfile: str, config: FetchConfig):
128128- _prefetch = generate_pkg_nix
129129-130130- def update() -> dict:
131131- plugin_specs = self.load_plugin_spec(input_file)
132132- sorted_plugin_specs = sorted(plugin_specs, key=lambda v: v.name.lower())
133133-134134- try:
135135- pool = Pool(processes=config.proc)
136136- results = pool.map(_prefetch, sorted_plugin_specs)
137137- finally:
138138- pass
139139-140140- self.generate_nix(results, outfile)
141141-142142- redirects = {}
143143- return redirects
144144-145145- return update
146146-147147- def rewrite_input(self, input_file: str, *args, **kwargs):
148148- # vim plugin reads the file before update but that shouldn't be our case
149149- # not implemented yet
150150- # fieldnames = ['name', 'server', 'version', 'luaversion', 'maintainers']
151151- # input_file = "toto.csv"
152152- # with open(input_file, newline='') as csvfile:
153153- # writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
154154- # writer.writeheader()
155155- # for row in reader:
156156- # # name,server,version,luaversion,maintainers
157157- # plugin = LuaPlugin(**row)
158158- # luaPackages.append(plugin)
159159- pass
160160-161161-162162-def generate_pkg_nix(plug: LuaPlugin):
163163- """
164164- Generate nix expression for a luarocks package
165165- Our cache key associates "p.name-p.version" to its rockspec
166166- """
167167- log.debug("Generating nix expression for %s", plug.name)
168168- custom_env = os.environ.copy()
169169- custom_env["LUAROCKS_CONFIG"] = LUAROCKS_CONFIG
170170-171171- # we add --dev else luarocks wont find all the "scm" (=dev) versions of the
172172- # packages
173173- # , "--dev"
174174- cmd = ["luarocks", "nix"]
175175-176176- if plug.maintainers:
177177- cmd.append(f"--maintainers={plug.maintainers}")
178178-179179- # if plug.server == "src":
180180- if plug.src != "":
181181- if plug.src is None:
182182- msg = (
183183- "src must be set when 'version' is set to \"src\" for package %s"
184184- % plug.name
185185- )
186186- log.error(msg)
187187- raise RuntimeError(msg)
188188- log.debug("Updating from source %s", plug.src)
189189- cmd.append(plug.src)
190190- # update the plugin from luarocks
191191- else:
192192- cmd.append(plug.name)
193193- if plug.version and plug.version != "src":
194194- cmd.append(plug.version)
195195-196196- if plug.server != "src" and plug.server:
197197- cmd.append(f"--only-server={plug.server}")
198198-199199- if plug.luaversion:
200200- cmd.append(f"--lua-version={plug.luaversion}")
201201-202202- log.debug("running %s", " ".join(cmd))
203203-204204- output = subprocess.check_output(cmd, env=custom_env, text=True)
205205- output = "callPackage(" + output.strip() + ") {};\n\n"
206206- return (plug, output)
207207-208208-209209-def main():
210210- editor = LuaEditor(
211211- "lua",
212212- ROOT,
213213- "",
214214- default_in=ROOT.joinpath(PKG_LIST),
215215- default_out=ROOT.joinpath(GENERATED_NIXFILE),
216216- )
217217-218218- editor.run()
219219-220220-221221-if __name__ == "__main__":
222222- main()
223223-224224-# vim: set ft=python noet fdm=manual fenc=utf-8 ff=unix sts=0 sw=4 ts=4 :
···162162163163- `getent` has been moved from `glibc`'s `bin` output to its own dedicated output, reducing closure size for many dependents. Dependents using the `getent` alias should not be affected; others should move from using `glibc.bin` or `getBin glibc` to `getent` (which also improves compatibility with non-glibc platforms).
164164165165+- `maintainers/scripts/update-luarocks-packages` is now a proper package
166166+ `luarocks-packages-updater` that can be run to maintain out-of-tree luarocks
167167+ packages
168168+165169- The `users.users.<name>.passwordFile` has been renamed to `users.users.<name>.hashedPasswordFile` to avoid possible confusions. The option is in fact the file-based version of `hashedPassword`, not `password`, and expects a file containing the {manpage}`crypt(3)` hash of the user password.
170170+171171+- `chromiumBeta` and `chromiumDev` have been removed due to the lack of maintenance in nixpkgs. Consider using `chromium` instead.
172172+173173+- `google-chrome-beta` and `google-chrome-dev` have been removed due to the lack of maintenance in nixpkgs. Consider using `google-chrome` instead.
166174167175- The `services.ananicy.extraRules` option now has the type of `listOf attrs` instead of `string`.
168176···399407- `buildGoModule` `go-modules` attrs have been renamed to `goModules`.
400408401409- The `fonts.fonts` and `fonts.enableDefaultFonts` options have been renamed to `fonts.packages` and `fonts.enableDefaultPackages` respectively.
410410+411411+- The `services.sslh` module has been updated to follow [RFC 0042](https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md). As such, several options have been moved to the freeform attribute set [services.sslh.settings](#opt-services.sslh.settings), which allows to change any of the settings in {manpage}`sslh(8)`.
412412+ In addition, the newly added option [services.sslh.method](#opt-services.sslh.method) allows to switch between the {manpage}`fork(2)`, {manpage}`select(2)` and `libev`-based connection handling method; see the [sslh docs](https://github.com/yrutschle/sslh/blob/master/doc/INSTALL.md#binaries) for a comparison.
402413403414- `pkgs.openvpn3` now optionally supports systemd-resolved. `programs.openvpn3` will automatically enable systemd-resolved support if `config.services.resolved.enable` is enabled.
404415
···937937 enableOCR = true;
938938 preBootCommands = ''
939939 machine.start()
940940+ # Enter it wrong once
941941+ machine.wait_for_text("enter passphrase for ")
942942+ machine.send_chars("wrong\n")
943943+ # Then enter it right.
940944 machine.wait_for_text("enter passphrase for ")
941945 machine.send_chars("password\n")
942946 '';
···151151 """Maps a channel name to the corresponding main Nixpkgs attribute name."""
152152 if channel_name == 'stable':
153153 return 'chromium'
154154- if channel_name == 'beta':
155155- return 'chromiumBeta'
156156- if channel_name == 'dev':
157157- return 'chromiumDev'
158154 if channel_name == 'ungoogled-chromium':
159155 return 'ungoogled-chromium'
160156 print(f'Error: Unexpected channel: {channel_name}', file=sys.stderr)
···204200 # If we've already found a newer release for this channel, we're
205201 # no longer interested in it.
206202 if channel_name in channels:
203203+ continue
204204+205205+ # We only look for channels that are listed in our version pin file.
206206+ if channel_name not in last_channels:
207207 continue
208208209209 # If we're back at the last release we used, we don't need to
···134134 chefdk = throw "chefdk has been removed due to being deprecated upstream by Chef Workstation"; # Added 2023-03-22
135135 chocolateDoom = chocolate-doom; # Added 2023-05-01
136136 chrome-gnome-shell = gnome-browser-connector; # Added 2022-07-27
137137+ chromiumBeta = throw "'chromiumBeta' has been removed due to the lack of maintenance in nixpkgs. Consider using 'chromium' instead."; # Added 2023-10-18
138138+ chromiumDev = throw "'chromiumDev' has been removed due to the lack of maintenance in nixpkgs. Consider using 'chromium' instead."; # Added 2023-10-18
137139 citra = citra-nightly; # added 2022-05-17
138140 clang-ocl = throw "'clang-ocl' has been replaced with 'rocmPackages.clang-ocl'"; # Added 2023-10-08
139141 inherit (libsForQt5.mauiPackages) clip; # added 2022-05-17
···317319 godot-headless = throw "godot-headless has been renamed to godot3-headless to distinguish from version 4"; # Added 2023-07-16
318320 godot-server = throw "godot-server has been renamed to godot3-server to distinguish from version 4"; # Added 2023-07-16
319321322322+ google-chrome-beta = throw "'google-chrome-beta' has been removed due to the lack of maintenance in nixpkgs. Consider using 'google-chrome' instead."; # Added 2023-10-18
323323+ google-chrome-dev = throw "'google-chrome-dev' has been removed due to the lack of maintenance in nixpkgs. Consider using 'google-chrome' instead."; # Added 2023-10-18
320324 google-gflags = throw "'google-gflags' has been renamed to/replaced by 'gflags'"; # Converted to throw 2023-09-10
321325 go-thumbnailer = thud; # Added 2023-09-21
322326 gometer = throw "gometer has been removed from nixpkgs because goLance stopped offering Linux support"; # Added 2023-02-10