···9697# nixos/*: add trivial defaultText for options with simple defaults
9825124556397ba17bfd70297000270de1e6523b0a
000000
···9697# nixos/*: add trivial defaultText for options with simple defaults
9825124556397ba17bfd70297000270de1e6523b0a
99+100+# systemd: rewrite comments
101+92dfeb7b3dab820ae307c56c216d175c69ee93cd
102+103+# systemd: break too long lines of Nix code
104+67643f8ec84bef1482204709073e417c9f07eb87
+1-1
COPYING
···1-Copyright (c) 2003-2023 Eelco Dolstra and the Nixpkgs/NixOS contributors
23Permission is hereby granted, free of charge, to any person obtaining
4a copy of this software and associated documentation files (the
···1+Copyright (c) 2003-2024 Eelco Dolstra and the Nixpkgs/NixOS contributors
23Permission is hereby granted, free of charge, to any person obtaining
4a copy of this software and associated documentation files (the
+5-4
lib/attrsets.nix
···34let
5 inherit (builtins) head tail length;
6- inherit (lib.trivial) id mergeAttrs;
7 inherit (lib.strings) concatStringsSep concatMapStringsSep escapeNixIdentifier sanitizeDerivationName;
8 inherit (lib.lists) foldr foldl' concatMap concatLists elemAt all partition groupBy take foldl;
9in
···1197 (x // y) // mask;
11981199 # DEPRECATED
1200- zipWithNames = zipAttrsWithNames;
012011202 # DEPRECATED
1203- zip = builtins.trace
1204- "lib.zip is deprecated, use lib.zipAttrsWith instead" zipAttrsWith;
1205}
···34let
5 inherit (builtins) head tail length;
6+ inherit (lib.trivial) id mergeAttrs warn;
7 inherit (lib.strings) concatStringsSep concatMapStringsSep escapeNixIdentifier sanitizeDerivationName;
8 inherit (lib.lists) foldr foldl' concatMap concatLists elemAt all partition groupBy take foldl;
9in
···1197 (x // y) // mask;
11981199 # DEPRECATED
1200+ zipWithNames = warn
1201+ "lib.zipWithNames is a deprecated alias of lib.zipAttrsWithNames." zipAttrsWithNames;
12021203 # DEPRECATED
1204+ zip = warn
1205+ "lib.zip is a deprecated alias of lib.zipAttrsWith." zipAttrsWith;
1206}
···379 if ! isString text then throw "literalExpression expects a string."
380 else { _type = "literalExpression"; inherit text; };
381382- literalExample = lib.warn "literalExample is deprecated, use literalExpression instead, or use literalMD for a non-Nix description." literalExpression;
383384 /* Transition marker for documentation that's already migrated to markdown
385 syntax. This is a no-op and no longer needed.
···379 if ! isString text then throw "literalExpression expects a string."
380 else { _type = "literalExpression"; inherit text; };
381382+ literalExample = lib.warn "lib.literalExample is deprecated, use lib.literalExpression instead, or use lib.literalMD for a non-Nix description." literalExpression;
383384 /* Transition marker for documentation that's already migrated to markdown
385 syntax. This is a no-op and no longer needed.
+2-2
lib/strings.nix
···561 [""" "'" "<" ">" "&"];
562563 # warning added 12-12-2022
564- replaceChars = lib.warn "replaceChars is a deprecated alias of replaceStrings, replace usages of it with replaceStrings." builtins.replaceStrings;
565566 # Case conversion utilities.
567 lowerChars = stringToCharacters "abcdefghijklmnopqrstuvwxyz";
···1133 "/prefix/nix-profiles-library-paths.patch"
1134 "/prefix/compose-search-path.patch" ]
1135 */
1136- readPathsFromFile = lib.warn "lib.readPathsFromFile is deprecated, use a list instead"
1137 (rootPath: file:
1138 let
1139 lines = lib.splitString "\n" (readFile file);
···561 [""" "'" "<" ">" "&"];
562563 # warning added 12-12-2022
564+ replaceChars = lib.warn "lib.replaceChars is a deprecated alias of lib.replaceStrings." builtins.replaceStrings;
565566 # Case conversion utilities.
567 lowerChars = stringToCharacters "abcdefghijklmnopqrstuvwxyz";
···1133 "/prefix/nix-profiles-library-paths.patch"
1134 "/prefix/compose-search-path.patch" ]
1135 */
1136+ readPathsFromFile = lib.warn "lib.readPathsFromFile is deprecated, use a list instead."
1137 (rootPath: file:
1138 let
1139 lines = lib.splitString "\n" (readFile file);
+1
lib/systems/inspect.nix
···48 isRiscV64 = { cpu = { family = "riscv"; bits = 64; }; };
49 isRx = { cpu = { family = "rx"; }; };
50 isSparc = { cpu = { family = "sparc"; }; };
051 isWasm = { cpu = { family = "wasm"; }; };
52 isMsp430 = { cpu = { family = "msp430"; }; };
53 isVc4 = { cpu = { family = "vc4"; }; };
···48 isRiscV64 = { cpu = { family = "riscv"; bits = 64; }; };
49 isRx = { cpu = { family = "rx"; }; };
50 isSparc = { cpu = { family = "sparc"; }; };
51+ isSparc64 = { cpu = { family = "sparc"; bits = 64; }; };
52 isWasm = { cpu = { family = "wasm"; }; };
53 isMsp430 = { cpu = { family = "msp430"; }; };
54 isVc4 = { cpu = { family = "vc4"; }; };
+1-1
lib/trivial.nix
···230 else if lib.pathExists revisionFile then lib.fileContents revisionFile
231 else default;
232233- nixpkgsVersion = builtins.trace "`lib.nixpkgsVersion` is deprecated, use `lib.version` instead!" version;
234235 /* Determine whether the function is being called from inside a Nix
236 shell.
···230 else if lib.pathExists revisionFile then lib.fileContents revisionFile
231 else default;
232233+ nixpkgsVersion = warn "lib.nixpkgsVersion is a deprecated alias of lib.version." version;
234235 /* Determine whether the function is being called from inside a Nix
236 shell.
···1+# Overlayfs {#sec-overlayfs}
2+3+NixOS offers a convenient abstraction to create both read-only as well writable
4+overlays.
5+6+```nix
7+fileSystems = {
8+ "/writable-overlay" = {
9+ overlay = {
10+ lowerdir = [ writableOverlayLowerdir ];
11+ upperdir = "/.rw-writable-overlay/upper";
12+ workdir = "/.rw-writable-overlay/work";
13+ };
14+ # Mount the writable overlay in the initrd.
15+ neededForBoot = true;
16+ };
17+ "/readonly-overlay".overlay.lowerdir = [
18+ writableOverlayLowerdir
19+ writableOverlayLowerdir2
20+ ];
21+};
22+```
23+24+If `upperdir` and `workdir` are not null, they will be created before the
25+overlay is mounted.
26+27+To mount an overlay as read-only, you need to provide at least two `lowerdir`s.
+20
nixos/doc/manual/release-notes/rl-2405.section.md
···89<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
10000011- `screen`'s module has been cleaned, and will now require you to set `programs.screen.enable` in order to populate `screenrc` and add the program to the environment.
1213- `linuxPackages_testing_bcachefs` is now fully deprecated by `linuxPackages_latest`, and is therefore no longer available.
···246- `services.postgresql.extraPlugins` changed its type from just a list of packages to also a function that returns such a list.
247 For example a config line like ``services.postgresql.extraPlugins = with pkgs.postgresql_11.pkgs; [ postgis ];`` is recommended to be changed to ``services.postgresql.extraPlugins = ps: with ps; [ postgis ];``;
248000249- Programs written in [Nim](https://nim-lang.org/) are built with libraries selected by lockfiles.
250 The `nimPackages` and `nim2Packages` sets have been removed.
251 See https://nixos.org/manual/nixpkgs/unstable#nim for more information.
···254 This version of Portunus supports strong password hashes, but the legacy hash SHA-256 is also still supported to ensure a smooth migration of existing user accounts.
255 After upgrading, follow the instructions on the [upstream release notes](https://github.com/majewsky/portunus/releases/tag/v2.0.0) to upgrade all user accounts to strong password hashes.
256 Support for weak password hashes will be removed in NixOS 24.11.
00257258- `libass` now uses the native CoreText backend on Darwin, which may fix subtitle rendering issues with `mpv`, `ffmpeg`, etc.
259···272- The option [`services.nextcloud.config.dbport`] of the Nextcloud module was removed to match upstream.
273 The port can be specified in [`services.nextcloud.config.dbhost`](#opt-services.nextcloud.config.dbhost).
27400000275- `stdenv`: The `--replace` flag in `substitute`, `substituteInPlace`, `substituteAll`, `substituteAllStream`, and `substituteStream` is now deprecated if favor of the new `--replace-fail`, `--replace-warn` and `--replace-quiet`. The deprecated `--replace` equates to `--replace-warn`.
00276277- New options were added to the dnsdist module to enable and configure a DNSCrypt endpoint (see `services.dnsdist.dnscrypt.enable`, etc.).
278 The module can generate the DNSCrypt provider key pair, certificates and also performs their rotation automatically with no downtime.
···290 `globalRedirect` can now have redirect codes other than 301 through
291 `redirectCode`.
29200293- The source of the `mockgen` package has changed to the [go.uber.org/mock](https://github.com/uber-go/mock) fork because [the original repository is no longer maintained](https://github.com/golang/mock#gomock).
294295- `security.pam.enableSSHAgentAuth` was renamed to `security.pam.sshAgentAuth.enable` and an `authorizedKeysFiles`
···297 **which is insecure**: see [#31611](https://github.com/NixOS/nixpkgs/issues/31611).
298299- [](#opt-boot.kernel.sysctl._net.core.wmem_max_) changed from a string to an integer because of the addition of a custom merge option (taking the highest value defined to avoid conflicts between 2 services trying to set that value), just as [](#opt-boot.kernel.sysctl._net.core.rmem_max_) since 22.11.
00300301- `services.zfs.zed.enableMail` now uses the global `sendmail` wrapper defined by an email module
302 (such as msmtp or Postfix). It no longer requires using a special ZFS build with email support.
···89<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
1011+- `cryptsetup` has been upgraded from 2.6.1 to 2.7.0. Cryptsetup is a critical component enabling LUKS-based (but not only) full disk encryption.
12+ Take the time to review [the release notes](https://gitlab.com/cryptsetup/cryptsetup/-/raw/v2.7.0/docs/v2.7.0-ReleaseNotes).
13+ One of the highlight is that it is now possible to use hardware OPAL-based encryption of your disk with `cryptsetup`, it has a lot of caveats, see the above notes for the full details.
14+15- `screen`'s module has been cleaned, and will now require you to set `programs.screen.enable` in order to populate `screenrc` and add the program to the environment.
1617- `linuxPackages_testing_bcachefs` is now fully deprecated by `linuxPackages_latest`, and is therefore no longer available.
···250- `services.postgresql.extraPlugins` changed its type from just a list of packages to also a function that returns such a list.
251 For example a config line like ``services.postgresql.extraPlugins = with pkgs.postgresql_11.pkgs; [ postgis ];`` is recommended to be changed to ``services.postgresql.extraPlugins = ps: with ps; [ postgis ];``;
252253+- The Matrix homeserver [Synapse](https://element-hq.github.io/synapse/) module now supports configuring UNIX domain socket [listeners](#opt-services.matrix-synapse.settings.listeners) through the `path` option.
254+ The default replication worker on the main instance has been migrated away from TCP sockets to UNIX domain sockets.
255+256- Programs written in [Nim](https://nim-lang.org/) are built with libraries selected by lockfiles.
257 The `nimPackages` and `nim2Packages` sets have been removed.
258 See https://nixos.org/manual/nixpkgs/unstable#nim for more information.
···261 This version of Portunus supports strong password hashes, but the legacy hash SHA-256 is also still supported to ensure a smooth migration of existing user accounts.
262 After upgrading, follow the instructions on the [upstream release notes](https://github.com/majewsky/portunus/releases/tag/v2.0.0) to upgrade all user accounts to strong password hashes.
263 Support for weak password hashes will be removed in NixOS 24.11.
264+265+- A stdenv's default set of hardening flags can now be set via its `bintools-wrapper`'s `defaultHardeningFlags` argument. A convenient stdenv adapter, `withDefaultHardeningFlags`, can be used to override an existing stdenv's `defaultHardeningFlags`.
266267- `libass` now uses the native CoreText backend on Darwin, which may fix subtitle rendering issues with `mpv`, `ffmpeg`, etc.
268···281- The option [`services.nextcloud.config.dbport`] of the Nextcloud module was removed to match upstream.
282 The port can be specified in [`services.nextcloud.config.dbhost`](#opt-services.nextcloud.config.dbhost).
283284+- A new abstraction to create both read-only as well as writable overlay file
285+ systems was added. Available via
286+ [fileSystems.overlay](#opt-fileSystems._name_.overlay.lowerdir). See also the
287+ [NixOS docs](#sec-overlayfs).
288+289- `stdenv`: The `--replace` flag in `substitute`, `substituteInPlace`, `substituteAll`, `substituteAllStream`, and `substituteStream` is now deprecated if favor of the new `--replace-fail`, `--replace-warn` and `--replace-quiet`. The deprecated `--replace` equates to `--replace-warn`.
290+291+- A new hardening flag, `zerocallusedregs` was made available, corresponding to the gcc/clang option `-fzero-call-used-regs=used-gpr`.
292293- New options were added to the dnsdist module to enable and configure a DNSCrypt endpoint (see `services.dnsdist.dnscrypt.enable`, etc.).
294 The module can generate the DNSCrypt provider key pair, certificates and also performs their rotation automatically with no downtime.
···306 `globalRedirect` can now have redirect codes other than 301 through
307 `redirectCode`.
308309+- `libjxl` 0.9.0 [dropped support for the butteraugli API](https://github.com/libjxl/libjxl/pull/2576). You will no longer be able to set `enableButteraugli` on `libaom`.
310+311- The source of the `mockgen` package has changed to the [go.uber.org/mock](https://github.com/uber-go/mock) fork because [the original repository is no longer maintained](https://github.com/golang/mock#gomock).
312313- `security.pam.enableSSHAgentAuth` was renamed to `security.pam.sshAgentAuth.enable` and an `authorizedKeysFiles`
···315 **which is insecure**: see [#31611](https://github.com/NixOS/nixpkgs/issues/31611).
316317- [](#opt-boot.kernel.sysctl._net.core.wmem_max_) changed from a string to an integer because of the addition of a custom merge option (taking the highest value defined to avoid conflicts between 2 services trying to set that value), just as [](#opt-boot.kernel.sysctl._net.core.rmem_max_) since 22.11.
318+319+- A new top-level package set, `pkgsExtraHardening` is added. This is a set of packages built with stricter hardening flags - those that have not yet received enough testing to be applied universally, those that are more likely to cause build failures or those that have drawbacks to their use (e.g. performance or required hardware features).
320321- `services.zfs.zed.enableMail` now uses the global `sendmail` wrapper defined by an email module
322 (such as msmtp or Postfix). It no longer requires using a special ZFS build with email support.
+7
nixos/maintainers/scripts/ec2/README.md
···0000000
···1+# Amazon images
2+3+* The `create-amis.sh` script will be replaced by https://github.com/NixOS/amis which will regularly upload AMIs per NixOS channel bump.
4+5+* @arianvp is planning to drop zfs support
6+* @arianvp is planning to rewrite the image builder to use the repart-based image builder.
7+
+2
nixos/maintainers/scripts/ec2/amazon-image.nix
···157 '';
158 };
159 in if config.ec2.zfs.enable then zfsBuilder else extBuilder;
00160}
···157 '';
158 };
159 in if config.ec2.zfs.enable then zfsBuilder else extBuilder;
160+161+ meta.maintainers = with maintainers; [ arianvp ];
162}
···46 config = mkIf config.services.pcscd.enable {
47 environment.etc."reader.conf".source = cfgFile;
4849+ environment.systemPackages = [ package ];
50+ systemd.packages = [ package ];
5152 services.pcscd.plugins = [ pkgs.ccid ];
53···64 # around it, we force the path to the cfgFile.
65 #
66 # https://github.com/NixOS/nixpkgs/issues/121088
67+ serviceConfig.ExecStart = [ "" "${package}/bin/pcscd -f -x -c ${cfgFile}" ];
68 };
69 };
70}
+3-2
nixos/modules/services/matrix/synapse.md
···126Otherwise, or you can generate a registration secret with
127{command}`pwgen -s 64 1` and set it with
128[](#opt-services.matrix-synapse.settings.registration_shared_secret).
129-To create a new user or admin, run the following after you have set the secret
130-and have rebuilt NixOS:
0131```ShellSession
132$ nix-shell -p matrix-synapse
133$ register_new_matrix_user -k your-registration-shared-secret http://localhost:8008
···126Otherwise, or you can generate a registration secret with
127{command}`pwgen -s 64 1` and set it with
128[](#opt-services.matrix-synapse.settings.registration_shared_secret).
129+To create a new user or admin from the terminal your client listener
130+must be configured to use TCP sockets. Then you can run the following
131+after you have set the secret and have rebuilt NixOS:
132```ShellSession
133$ nix-shell -p matrix-synapse
134$ register_new_matrix_user -k your-registration-shared-secret http://localhost:8008
+146-20
nixos/modules/services/matrix/synapse.nix
···6 cfg = config.services.matrix-synapse;
7 format = pkgs.formats.yaml { };
8000000009 # remove null values from the final configuration
10- finalSettings = lib.filterAttrsRecursive (_: v: v != null) cfg.settings;
11 configFile = format.generate "homeserver.yaml" finalSettings;
1213 usePostgresql = cfg.settings.database.name == "psycopg2";
···105 SYSLOG_IDENTIFIER = logName;
106 };
107 });
0000000000000108in {
109110 imports = [
···192 ];
193194 options = let
195- listenerType = workerContext: types.submodule {
196 options = {
197 port = mkOption {
198- type = types.port;
0199 example = 8448;
200 description = lib.mdDoc ''
201 The port to listen for HTTP(S) requests on.
···203 };
204205 bind_addresses = mkOption {
206- type = types.listOf types.str;
207- default = [
208 "::1"
209 "127.0.0.1"
210 ];
000000000211 example = literalExpression ''
212 [
213 "::"
···219 '';
220 };
22100000000000000000000000000000222 type = mkOption {
223 type = types.enum [
224 "http"
···234 };
235236 tls = mkOption {
237- type = types.bool;
238- default = !workerContext;
000000239 example = false;
240 description = lib.mdDoc ''
241 Whether to enable TLS on the listener socket.
0000242 '';
243 };
244245 x_forwarded = mkOption {
246 type = types.bool;
247- default = false;
000248 example = true;
249 description = lib.mdDoc ''
250 Use the X-Forwarded-For (XFF) header as the client IP and not the
···291 '';
292 };
293 };
294- };
295 in {
296 services.matrix-synapse = {
297 enable = mkEnableOption (lib.mdDoc "matrix.org synapse");
29800000000000000000299 serviceUnit = lib.mkOption {
300 type = lib.types.str;
301 readOnly = true;
···616 compress = false;
617 }];
618 }] ++ lib.optional hasWorkers {
619- port = 9093;
620- bind_addresses = [ "127.0.0.1" ];
621 type = "http";
622- tls = false;
623- x_forwarded = false;
624 resources = [{
625 names = [ "replication" ];
626 compress = false;
···630 List of ports that Synapse should listen on, their purpose and their configuration.
631632 By default, synapse will be configured for client and federation traffic on port 8008, and
633- for worker replication traffic on port 9093. See [`services.matrix-synapse.workers`](#opt-services.matrix-synapse.workers)
634 for more details.
635 '';
636 };
···1006 listener = lib.findFirst
1007 (
1008 listener:
1009- listener.port == main.port
0001010 && listenerSupportsResource "replication" listener
1011- && (lib.any (bind: bind == main.host || bind == "0.0.0.0" || bind == "::") listener.bind_addresses)
0001012 )
1013 null
1014 cfg.settings.listeners;
···1022 This is done by default unless you manually configure either of those settings.
1023 '';
1024 }
1025- ];
00000000000000000000000000000010261027 services.matrix-synapse.settings.redis = lib.mkIf cfg.configureRedisLocally {
1028 enabled = true;
1029 path = config.services.redis.servers.matrix-synapse.unixSocket;
1030 };
1031 services.matrix-synapse.settings.instance_map.main = lib.mkIf hasWorkers (lib.mkDefault {
1032- host = "127.0.0.1";
1033- port = 9093;
1034 });
10351036 services.matrix-synapse.serviceUnit = if hasWorkers then "matrix-synapse.target" else "matrix-synapse.service";
···1086 User = "matrix-synapse";
1087 Group = "matrix-synapse";
1088 WorkingDirectory = cfg.dataDir;
001089 ExecReload = "${pkgs.util-linux}/bin/kill -HUP $MAINPID";
1090 Restart = "on-failure";
1091 UMask = "0077";
···1178 user = "matrix-synapse";
1179 };
11801181- environment.systemPackages = [ registerNewMatrixUser ];
001182 };
11831184 meta = {
···6 cfg = config.services.matrix-synapse;
7 format = pkgs.formats.yaml { };
89+ filterRecursiveNull = o:
10+ if isAttrs o then
11+ mapAttrs (_: v: filterRecursiveNull v) (filterAttrs (_: v: v != null) o)
12+ else if isList o then
13+ map filterRecursiveNull (filter (v: v != null) o)
14+ else
15+ o;
16+17 # remove null values from the final configuration
18+ finalSettings = filterRecursiveNull cfg.settings;
19 configFile = format.generate "homeserver.yaml" finalSettings;
2021 usePostgresql = cfg.settings.database.name == "psycopg2";
···113 SYSLOG_IDENTIFIER = logName;
114 };
115 });
116+117+ toIntBase8 = str:
118+ lib.pipe str [
119+ lib.stringToCharacters
120+ (map lib.toInt)
121+ (lib.foldl (acc: digit: acc * 8 + digit) 0)
122+ ];
123+124+ toDecimalFilePermission = value:
125+ if value == null then
126+ null
127+ else
128+ toIntBase8 value;
129in {
130131 imports = [
···213 ];
214215 options = let
216+ listenerType = workerContext: types.submodule ({ config, ... }: {
217 options = {
218 port = mkOption {
219+ type = types.nullOr types.port;
220+ default = null;
221 example = 8448;
222 description = lib.mdDoc ''
223 The port to listen for HTTP(S) requests on.
···225 };
226227 bind_addresses = mkOption {
228+ type = types.nullOr (types.listOf types.str);
229+ default = if config.path != null then null else [
230 "::1"
231 "127.0.0.1"
232 ];
233+ defaultText = literalExpression ''
234+ if path != null then
235+ null
236+ else
237+ [
238+ "::1"
239+ "127.0.0.1"
240+ ]
241+ '';
242 example = literalExpression ''
243 [
244 "::"
···250 '';
251 };
252253+ path = mkOption {
254+ type = types.nullOr types.path;
255+ default = null;
256+ description = ''
257+ Unix domain socket path to bind this listener to.
258+259+ ::: {.note}
260+ This option is incompatible with {option}`bind_addresses`, {option}`port`, {option}`tls`
261+ and also does not support the `metrics` and `manhole` listener {option}`type`.
262+ :::
263+ '';
264+ };
265+266+ mode = mkOption {
267+ type = types.nullOr (types.strMatching "^[0,2-7]{3,4}$");
268+ default = if config.path != null then "660" else null;
269+ defaultText = literalExpression ''
270+ if path != null then
271+ "660"
272+ else
273+ null
274+ '';
275+ example = "660";
276+ description = ''
277+ File permissions on the UNIX domain socket.
278+ '';
279+ apply = toDecimalFilePermission;
280+ };
281+282 type = mkOption {
283 type = types.enum [
284 "http"
···294 };
295296 tls = mkOption {
297+ type = types.nullOr types.bool;
298+ default = if config.path != null then
299+ null
300+ else
301+ !workerContext;
302+ defaultText = ''
303+ Enabled for the main instance listener, unless it is configured with a UNIX domain socket path.
304+ '';
305 example = false;
306 description = lib.mdDoc ''
307 Whether to enable TLS on the listener socket.
308+309+ ::: {.note}
310+ This option will be ignored for UNIX domain sockets.
311+ :::
312 '';
313 };
314315 x_forwarded = mkOption {
316 type = types.bool;
317+ default = config.path != null;
318+ defaultText = ''
319+ Enabled if the listener is configured with a UNIX domain socket path
320+ '';
321 example = true;
322 description = lib.mdDoc ''
323 Use the X-Forwarded-For (XFF) header as the client IP and not the
···364 '';
365 };
366 };
367+ });
368 in {
369 services.matrix-synapse = {
370 enable = mkEnableOption (lib.mdDoc "matrix.org synapse");
371372+ enableRegistrationScript = mkOption {
373+ type = types.bool;
374+ default = clientListener.bind_addresses != [];
375+ example = false;
376+ defaultText = ''
377+ Enabled if the client listener uses TCP sockets
378+ '';
379+ description = ''
380+ Whether to install the `register_new_matrix_user` script, that
381+ allows account creation on the terminal.
382+383+ ::: {.note}
384+ This script does not work when the client listener uses UNIX domain sockets
385+ :::
386+ '';
387+ };
388+389 serviceUnit = lib.mkOption {
390 type = lib.types.str;
391 readOnly = true;
···706 compress = false;
707 }];
708 }] ++ lib.optional hasWorkers {
709+ path = "/run/matrix-synapse/main_replication.sock";
0710 type = "http";
00711 resources = [{
712 names = [ "replication" ];
713 compress = false;
···717 List of ports that Synapse should listen on, their purpose and their configuration.
718719 By default, synapse will be configured for client and federation traffic on port 8008, and
720+ use a UNIX domain socket for worker replication. See [`services.matrix-synapse.workers`](#opt-services.matrix-synapse.workers)
721 for more details.
722 '';
723 };
···1093 listener = lib.findFirst
1094 (
1095 listener:
1096+ (
1097+ lib.hasAttr "port" main && listener.port or null == main.port
1098+ || lib.hasAttr "path" main && listener.path or null == main.path
1099+ )
1100 && listenerSupportsResource "replication" listener
1101+ && (
1102+ lib.hasAttr "host" main && lib.any (bind: bind == main.host || bind == "0.0.0.0" || bind == "::") listener.bind_addresses
1103+ || lib.hasAttr "path" main
1104+ )
1105 )
1106 null
1107 cfg.settings.listeners;
···1115 This is done by default unless you manually configure either of those settings.
1116 '';
1117 }
1118+ {
1119+ assertion = cfg.enableRegistrationScript -> clientListener.path == null;
1120+ message = ''
1121+ The client listener on matrix-synapse is configured to use UNIX domain sockets.
1122+ This configuration is incompatible with the `register_new_matrix_user` script.
1123+1124+ Disable `services.mastrix-synapse.enableRegistrationScript` to continue.
1125+ '';
1126+ }
1127+ ]
1128+ ++ (map (listener: {
1129+ assertion = (listener.path == null) != (listener.bind_addresses == null);
1130+ message = ''
1131+ Listeners require either a UNIX domain socket `path` or `bind_addresses` for a TCP socket.
1132+ '';
1133+ }) cfg.settings.listeners)
1134+ ++ (map (listener: {
1135+ assertion = listener.path != null -> (listener.bind_addresses == null && listener.port == null && listener.tls == null);
1136+ message = let
1137+ formatKeyValue = key: value: lib.optionalString (value != null) " - ${key}=${toString value}\n";
1138+ in ''
1139+ Listener configured with UNIX domain socket (${toString listener.path}) ignores the following options:
1140+ ${formatKeyValue "bind_addresses" listener.bind_addresses}${formatKeyValue "port" listener.port}${formatKeyValue "tls" listener.tls}
1141+ '';
1142+ }) cfg.settings.listeners)
1143+ ++ (map (listener: {
1144+ assertion = listener.path == null || listener.type == "http";
1145+ message = ''
1146+ Listener configured with UNIX domain socket (${toString listener.path}) only supports the "http" listener type.
1147+ '';
1148+ }) cfg.settings.listeners);
11491150 services.matrix-synapse.settings.redis = lib.mkIf cfg.configureRedisLocally {
1151 enabled = true;
1152 path = config.services.redis.servers.matrix-synapse.unixSocket;
1153 };
1154 services.matrix-synapse.settings.instance_map.main = lib.mkIf hasWorkers (lib.mkDefault {
1155+ path = "/run/matrix-synapse/main_replication.sock";
01156 });
11571158 services.matrix-synapse.serviceUnit = if hasWorkers then "matrix-synapse.target" else "matrix-synapse.service";
···1208 User = "matrix-synapse";
1209 Group = "matrix-synapse";
1210 WorkingDirectory = cfg.dataDir;
1211+ RuntimeDirectory = "matrix-synapse";
1212+ RuntimeDirectoryPreserve = true;
1213 ExecReload = "${pkgs.util-linux}/bin/kill -HUP $MAINPID";
1214 Restart = "on-failure";
1215 UMask = "0077";
···1302 user = "matrix-synapse";
1303 };
13041305+ environment.systemPackages = lib.optionals cfg.enableRegistrationScript [
1306+ registerNewMatrixUser
1307+ ];
1308 };
13091310 meta = {
+1-2
nixos/modules/services/misc/nix-gc.nix
···64 example = "--max-freed $((64 * 1024**3))";
65 type = lib.types.singleLineStr;
66 description = lib.mdDoc ''
67- Options given to {file}`nix-collect-garbage` when the
68- garbage collector is run automatically.
69 '';
70 };
71
···64 example = "--max-freed $((64 * 1024**3))";
65 type = lib.types.singleLineStr;
66 description = lib.mdDoc ''
67+ Options given to [`nix-collect-garbage`](https://nixos.org/manual/nix/stable/command-ref/nix-collect-garbage) when the garbage collector is run automatically.
068 '';
69 };
70
···701 type = types.listOf types.str;
702 default = [];
703 example = [ "-vga std" ];
704- description = lib.mdDoc "Options passed to QEMU.";
000705 };
706707 consoles = mkOption {
···732 description = lib.mdDoc ''
733 Networking-related command-line options that should be passed to qemu.
734 The default is to use userspace networking (SLiRP).
0735736 If you override this option, be advised to keep
737 ''${QEMU_NET_OPTS:+,$QEMU_NET_OPTS} (as seen in the example)
···1066 ''}
1067 '';
10681069- systemd.tmpfiles.rules = lib.mkIf config.boot.initrd.systemd.enable [
1070- "f /etc/NIXOS 0644 root root -"
1071- "d /boot 0644 root root -"
1072- ];
0000000010731074 # After booting, register the closure of the paths in
1075 # `virtualisation.additionalPaths' in the Nix database in the VM. This
···701 type = types.listOf types.str;
702 default = [];
703 example = [ "-vga std" ];
704+ description = lib.mdDoc ''
705+ Options passed to QEMU.
706+ See [QEMU User Documentation](https://www.qemu.org/docs/master/system/qemu-manpage) for a complete list.
707+ '';
708 };
709710 consoles = mkOption {
···735 description = lib.mdDoc ''
736 Networking-related command-line options that should be passed to qemu.
737 The default is to use userspace networking (SLiRP).
738+ See the [QEMU Wiki on Networking](https://wiki.qemu.org/Documentation/Networking) for details.
739740 If you override this option, be advised to keep
741 ''${QEMU_NET_OPTS:+,$QEMU_NET_OPTS} (as seen in the example)
···1070 ''}
1071 '';
10721073+ systemd.tmpfiles.settings."10-qemu-vm" = lib.mkIf config.boot.initrd.systemd.enable {
1074+ "/etc/NIXOS".f = {
1075+ mode = "0644";
1076+ user = "root";
1077+ group = "root";
1078+ };
1079+ "${config.boot.loader.efi.efiSysMountPoint}".d = {
1080+ mode = "0644";
1081+ user = "root";
1082+ group = "root";
1083+ };
1084+ };
10851086 # After booting, register the closure of the paths in
1087 # `virtualisation.additionalPaths' in the Nix database in the VM. This
···32fi
3334if (( "${NIX_DEBUG:-0}" >= 1 )); then
35- declare -a allHardeningFlags=(fortify fortify3 stackprotector pie pic strictoverflow format)
36 declare -A hardeningDisableMap=()
3738 # Determine which flags were effectively disabled so we can report below.
···109 format)
110 if (( "${NIX_DEBUG:-0}" >= 1 )); then echo HARDENING: enabling format >&2; fi
111 hardeningCFlagsBefore+=('-Wformat' '-Wformat-security' '-Werror=format-security')
0000112 ;;
113 *)
114 # Ignore unsupported. Checked in Nix that at least *some*
···32fi
3334if (( "${NIX_DEBUG:-0}" >= 1 )); then
35+ declare -a allHardeningFlags=(fortify fortify3 stackprotector pie pic strictoverflow format zerocallusedregs)
36 declare -A hardeningDisableMap=()
3738 # Determine which flags were effectively disabled so we can report below.
···109 format)
110 if (( "${NIX_DEBUG:-0}" >= 1 )); then echo HARDENING: enabling format >&2; fi
111 hardeningCFlagsBefore+=('-Wformat' '-Wformat-security' '-Werror=format-security')
112+ ;;
113+ zerocallusedregs)
114+ if (( "${NIX_DEBUG:-0}" >= 1 )); then echo HARDENING: enabling zerocallusedregs >&2; fi
115+ hardeningCFlagsBefore+=('-fzero-call-used-regs=used-gpr')
116 ;;
117 *)
118 # Ignore unsupported. Checked in Nix that at least *some*
+10-1
pkgs/build-support/cc-wrapper/default.nix
···223224 defaultHardeningFlags = bintools.defaultHardeningFlags or [];
225000000000226 darwinPlatformForCC = optionalString stdenv.targetPlatform.isDarwin (
227 if (targetPlatform.darwinPlatform == "macos" && isGNU) then "macosx"
228 else targetPlatform.darwinPlatform
···584 ## Hardening support
585 ##
586 + ''
587- export hardening_unsupported_flags="${builtins.concatStringsSep " " (cc.hardeningUnsupportedFlags or [])}"
588 ''
589590 # Machine flags. These are necessary to support
···223224 defaultHardeningFlags = bintools.defaultHardeningFlags or [];
225226+ # if cc.hardeningUnsupportedFlagsByTargetPlatform exists, this is
227+ # called with the targetPlatform as an argument and
228+ # cc.hardeningUnsupportedFlags is completely ignored - the function
229+ # is responsible for including the constant hardeningUnsupportedFlags
230+ # list however it sees fit.
231+ ccHardeningUnsupportedFlags = if cc ? hardeningUnsupportedFlagsByTargetPlatform
232+ then cc.hardeningUnsupportedFlagsByTargetPlatform targetPlatform
233+ else (cc.hardeningUnsupportedFlags or []);
234+235 darwinPlatformForCC = optionalString stdenv.targetPlatform.isDarwin (
236 if (targetPlatform.darwinPlatform == "macos" && isGNU) then "macosx"
237 else targetPlatform.darwinPlatform
···593 ## Hardening support
594 ##
595 + ''
596+ export hardening_unsupported_flags="${builtins.concatStringsSep " " ccHardeningUnsupportedFlags}"
597 ''
598599 # Machine flags. These are necessary to support
···1+{
2+ lib,
3+ buildNimPackage,
4+ fetchFromGitHub,
5+}:
6+buildNimPackage (final: prev: {
7+ pname = "nimlangserver";
8+ version = "1.2.0";
9+10+ # lock.json was generated by converting
11+ # nimble.lock into requires "<gitUrl>#revSha" in a dummy.nimble
12+ # for all packages and then running nim_lk on said dummy package
13+ # default nim_lk output fails because it attempts
14+ # to use branches that will not work instead of HEAD for packages
15+ lockFile = ./lock.json;
16+17+ src = fetchFromGitHub {
18+ owner = "nim-lang";
19+ repo = "langserver";
20+ rev = "71b59bfa77dabf6b8b381f6e18a1d963a1a658fc";
21+ hash = "sha256-dznegEhRHvztrNhBcUhW83RYgJpduwdGLWj/tJ//K8c=";
22+ };
23+24+ doCheck = false;
25+26+ meta = with lib;
27+ final.src.meta
28+ // {
29+ description = "The Nim language server implementation (based on nimsuggest)";
30+ license = licenses.mit;
31+ mainProgram = "nimlangserver";
32+ maintainers = with maintainers; [daylinmorgan];
33+ };
34+})
···1-REVERT https://github.com/python/cpython/commit/300d812fd1c4d9244e71de0d228cc72439d312a7
2---- b/Doc/library/asyncio-eventloop.rst
3-+++ a/Doc/library/asyncio-eventloop.rst
4-@@ -43,12 +43,10 @@
5-6- Get the current event loop.
7-8-+ If there is no current event loop set in the current OS thread,
9-+ the OS thread is main, and :func:`set_event_loop` has not yet
10-+ been called, asyncio will create a new event loop and set it as the
11-+ current one.
12-- When called from a coroutine or a callback (e.g. scheduled with
13-- call_soon or similar API), this function will always return the
14-- running event loop.
15--
16-- If there is no running event loop set, the function will return
17-- the result of ``get_event_loop_policy().get_event_loop()`` call.
18-19- Because this function has rather complex behavior (especially
20- when custom event loop policies are in use), using the
21-@@ -60,14 +58,10 @@
22- event loop.
23-24- .. deprecated:: 3.10
25-+ Emits a deprecation warning if there is no running event loop.
26-+ In future Python releases, this function may become an alias of
27-+ :func:`get_running_loop` and will accordingly raise a
28-+ :exc:`RuntimeError` if there is no running event loop.
29-- Deprecation warning is emitted if there is no current event loop.
30-- In Python 3.12 it will be an error.
31--
32-- .. note::
33-- In Python versions 3.10.0--3.10.8 this function
34-- (and other functions which used it implicitly) emitted a
35-- :exc:`DeprecationWarning` if there was no running event loop, even if
36-- the current loop was set.
37-38- .. function:: set_event_loop(loop)
39-40-reverted:
41---- b/Doc/library/asyncio-llapi-index.rst
42-+++ a/Doc/library/asyncio-llapi-index.rst
43-@@ -19,7 +19,7 @@
44- - The **preferred** function to get the running event loop.
45-46- * - :func:`asyncio.get_event_loop`
47-+ - Get an event loop instance (current or via the policy).
48-- - Get an event loop instance (running or current via the current policy).
49-50- * - :func:`asyncio.set_event_loop`
51- - Set the event loop as current via the current policy.
52-reverted:
53---- b/Doc/library/asyncio-policy.rst
54-+++ a/Doc/library/asyncio-policy.rst
55-@@ -112,11 +112,6 @@
56-57- On Windows, :class:`ProactorEventLoop` is now used by default.
58-59-- .. deprecated:: 3.10.9
60-- :meth:`get_event_loop` now emits a :exc:`DeprecationWarning` if there
61-- is no current event loop set and a new event loop has been implicitly
62-- created. In Python 3.12 it will be an error.
63--
64-65- .. class:: WindowsSelectorEventLoopPolicy
66-67-reverted:
68---- b/Lib/asyncio/events.py
69-+++ a/Lib/asyncio/events.py
70-@@ -650,21 +650,6 @@
71- if (self._local._loop is None and
72- not self._local._set_called and
73- threading.current_thread() is threading.main_thread()):
74-- stacklevel = 2
75-- try:
76-- f = sys._getframe(1)
77-- except AttributeError:
78-- pass
79-- else:
80-- while f:
81-- module = f.f_globals.get('__name__')
82-- if not (module == 'asyncio' or module.startswith('asyncio.')):
83-- break
84-- f = f.f_back
85-- stacklevel += 1
86-- import warnings
87-- warnings.warn('There is no current event loop',
88-- DeprecationWarning, stacklevel=stacklevel)
89- self.set_event_loop(self.new_event_loop())
90-91- if self._local._loop is None:
92-@@ -778,13 +763,12 @@
93-94-95- def _get_event_loop(stacklevel=3):
96-- # This internal method is going away in Python 3.12, left here only for
97-- # backwards compatibility with 3.10.0 - 3.10.8 and 3.11.0.
98-- # Similarly, this method's C equivalent in _asyncio is going away as well.
99-- # See GH-99949 for more details.
100- current_loop = _get_running_loop()
101- if current_loop is not None:
102- return current_loop
103-+ import warnings
104-+ warnings.warn('There is no current event loop',
105-+ DeprecationWarning, stacklevel=stacklevel)
106- return get_event_loop_policy().get_event_loop()
107-108-109-reverted:
110---- b/Lib/test/test_asyncio/test_base_events.py
111-+++ a/Lib/test/test_asyncio/test_base_events.py
112-@@ -752,7 +752,7 @@
113- def test_env_var_debug(self):
114- code = '\n'.join((
115- 'import asyncio',
116-+ 'loop = asyncio.get_event_loop()',
117-- 'loop = asyncio.new_event_loop()',
118- 'print(loop.get_debug())'))
119-120- # Test with -E to not fail if the unit test was run with
121-reverted:
122---- b/Lib/test/test_asyncio/test_events.py
123-+++ a/Lib/test/test_asyncio/test_events.py
124-@@ -2561,9 +2561,8 @@
125- def test_get_event_loop(self):
126- policy = asyncio.DefaultEventLoopPolicy()
127- self.assertIsNone(policy._local._loop)
128-+
129-+ loop = policy.get_event_loop()
130-- with self.assertWarns(DeprecationWarning) as cm:
131-- loop = policy.get_event_loop()
132-- self.assertEqual(cm.filename, __file__)
133- self.assertIsInstance(loop, asyncio.AbstractEventLoop)
134-135- self.assertIs(policy._local._loop, loop)
136-@@ -2577,10 +2576,7 @@
137- policy, "set_event_loop",
138- wraps=policy.set_event_loop) as m_set_event_loop:
139-140-+ loop = policy.get_event_loop()
141-- with self.assertWarns(DeprecationWarning) as cm:
142-- loop = policy.get_event_loop()
143-- self.addCleanup(loop.close)
144-- self.assertEqual(cm.filename, __file__)
145-146- # policy._local._loop must be set through .set_event_loop()
147- # (the unix DefaultEventLoopPolicy needs this call to attach
148-@@ -2614,8 +2610,7 @@
149-150- def test_set_event_loop(self):
151- policy = asyncio.DefaultEventLoopPolicy()
152-+ old_loop = policy.get_event_loop()
153-- old_loop = policy.new_event_loop()
154-- policy.set_event_loop(old_loop)
155-156- self.assertRaises(AssertionError, policy.set_event_loop, object())
157-158-@@ -2728,11 +2723,15 @@
159- asyncio.set_event_loop_policy(Policy())
160- loop = asyncio.new_event_loop()
161-162-+ with self.assertWarns(DeprecationWarning) as cm:
163-+ with self.assertRaises(TestError):
164-+ asyncio.get_event_loop()
165-+ self.assertEqual(cm.warnings[0].filename, __file__)
166-- with self.assertRaises(TestError):
167-- asyncio.get_event_loop()
168- asyncio.set_event_loop(None)
169-+ with self.assertWarns(DeprecationWarning) as cm:
170-+ with self.assertRaises(TestError):
171-+ asyncio.get_event_loop()
172-+ self.assertEqual(cm.warnings[0].filename, __file__)
173-- with self.assertRaises(TestError):
174-- asyncio.get_event_loop()
175-176- with self.assertRaisesRegex(RuntimeError, 'no running'):
177- asyncio.get_running_loop()
178-@@ -2746,11 +2745,16 @@
179- loop.run_until_complete(func())
180-181- asyncio.set_event_loop(loop)
182-+ with self.assertWarns(DeprecationWarning) as cm:
183-+ with self.assertRaises(TestError):
184-+ asyncio.get_event_loop()
185-+ self.assertEqual(cm.warnings[0].filename, __file__)
186-+
187-- with self.assertRaises(TestError):
188-- asyncio.get_event_loop()
189- asyncio.set_event_loop(None)
190-+ with self.assertWarns(DeprecationWarning) as cm:
191-+ with self.assertRaises(TestError):
192-+ asyncio.get_event_loop()
193-+ self.assertEqual(cm.warnings[0].filename, __file__)
194-- with self.assertRaises(TestError):
195-- asyncio.get_event_loop()
196-197- finally:
198- asyncio.set_event_loop_policy(old_policy)
199-@@ -2774,8 +2778,10 @@
200- self.addCleanup(loop2.close)
201- self.assertEqual(cm.warnings[0].filename, __file__)
202- asyncio.set_event_loop(None)
203-+ with self.assertWarns(DeprecationWarning) as cm:
204-+ with self.assertRaisesRegex(RuntimeError, 'no current'):
205-+ asyncio.get_event_loop()
206-+ self.assertEqual(cm.warnings[0].filename, __file__)
207-- with self.assertRaisesRegex(RuntimeError, 'no current'):
208-- asyncio.get_event_loop()
209-210- with self.assertRaisesRegex(RuntimeError, 'no running'):
211- asyncio.get_running_loop()
212-@@ -2789,11 +2795,15 @@
213- loop.run_until_complete(func())
214-215- asyncio.set_event_loop(loop)
216-+ with self.assertWarns(DeprecationWarning) as cm:
217-+ self.assertIs(asyncio.get_event_loop(), loop)
218-+ self.assertEqual(cm.warnings[0].filename, __file__)
219-- self.assertIs(asyncio.get_event_loop(), loop)
220-221- asyncio.set_event_loop(None)
222-+ with self.assertWarns(DeprecationWarning) as cm:
223-+ with self.assertRaisesRegex(RuntimeError, 'no current'):
224-+ asyncio.get_event_loop()
225-+ self.assertEqual(cm.warnings[0].filename, __file__)
226-- with self.assertRaisesRegex(RuntimeError, 'no current'):
227-- asyncio.get_event_loop()
228-229- finally:
230- asyncio.set_event_loop_policy(old_policy)
231-reverted:
232---- b/Lib/test/test_asyncio/test_futures.py
233-+++ a/Lib/test/test_asyncio/test_futures.py
234-@@ -145,8 +145,10 @@
235- self.assertTrue(f.cancelled())
236-237- def test_constructor_without_loop(self):
238-+ with self.assertWarns(DeprecationWarning) as cm:
239-+ with self.assertRaisesRegex(RuntimeError, 'There is no current event loop'):
240-+ self._new_future()
241-+ self.assertEqual(cm.warnings[0].filename, __file__)
242-- with self.assertRaisesRegex(RuntimeError, 'no current event loop'):
243-- self._new_future()
244-245- def test_constructor_use_running_loop(self):
246- async def test():
247-@@ -156,10 +158,12 @@
248- self.assertIs(f.get_loop(), self.loop)
249-250- def test_constructor_use_global_loop(self):
251-+ # Deprecated in 3.10
252-- # Deprecated in 3.10, undeprecated in 3.11.1
253- asyncio.set_event_loop(self.loop)
254- self.addCleanup(asyncio.set_event_loop, None)
255-+ with self.assertWarns(DeprecationWarning) as cm:
256-+ f = self._new_future()
257-+ self.assertEqual(cm.warnings[0].filename, __file__)
258-- f = self._new_future()
259- self.assertIs(f._loop, self.loop)
260- self.assertIs(f.get_loop(), self.loop)
261-262-@@ -495,8 +499,10 @@
263- return (arg, threading.get_ident())
264- ex = concurrent.futures.ThreadPoolExecutor(1)
265- f1 = ex.submit(run, 'oi')
266-+ with self.assertWarns(DeprecationWarning) as cm:
267-+ with self.assertRaises(RuntimeError):
268-+ asyncio.wrap_future(f1)
269-+ self.assertEqual(cm.warnings[0].filename, __file__)
270-- with self.assertRaisesRegex(RuntimeError, 'no current event loop'):
271-- asyncio.wrap_future(f1)
272- ex.shutdown(wait=True)
273-274- def test_wrap_future_use_running_loop(self):
275-@@ -511,14 +517,16 @@
276- ex.shutdown(wait=True)
277-278- def test_wrap_future_use_global_loop(self):
279-+ # Deprecated in 3.10
280-- # Deprecated in 3.10, undeprecated in 3.11.1
281- asyncio.set_event_loop(self.loop)
282- self.addCleanup(asyncio.set_event_loop, None)
283- def run(arg):
284- return (arg, threading.get_ident())
285- ex = concurrent.futures.ThreadPoolExecutor(1)
286- f1 = ex.submit(run, 'oi')
287-+ with self.assertWarns(DeprecationWarning) as cm:
288-+ f2 = asyncio.wrap_future(f1)
289-+ self.assertEqual(cm.warnings[0].filename, __file__)
290-- f2 = asyncio.wrap_future(f1)
291- self.assertIs(self.loop, f2._loop)
292- ex.shutdown(wait=True)
293-294-reverted:
295---- b/Lib/test/test_asyncio/test_streams.py
296-+++ a/Lib/test/test_asyncio/test_streams.py
297-@@ -747,8 +747,10 @@
298- self.assertEqual(data, b'data')
299-300- def test_streamreader_constructor_without_loop(self):
301-+ with self.assertWarns(DeprecationWarning) as cm:
302-+ with self.assertRaisesRegex(RuntimeError, 'There is no current event loop'):
303-+ asyncio.StreamReader()
304-+ self.assertEqual(cm.warnings[0].filename, __file__)
305-- with self.assertRaisesRegex(RuntimeError, 'no current event loop'):
306-- asyncio.StreamReader()
307-308- def test_streamreader_constructor_use_running_loop(self):
309- # asyncio issue #184: Ensure that StreamReaderProtocol constructor
310-@@ -762,17 +764,21 @@
311- def test_streamreader_constructor_use_global_loop(self):
312- # asyncio issue #184: Ensure that StreamReaderProtocol constructor
313- # retrieves the current loop if the loop parameter is not set
314-+ # Deprecated in 3.10
315-- # Deprecated in 3.10, undeprecated in 3.11.1
316- self.addCleanup(asyncio.set_event_loop, None)
317- asyncio.set_event_loop(self.loop)
318-+ with self.assertWarns(DeprecationWarning) as cm:
319-+ reader = asyncio.StreamReader()
320-+ self.assertEqual(cm.warnings[0].filename, __file__)
321-- reader = asyncio.StreamReader()
322- self.assertIs(reader._loop, self.loop)
323-324-325- def test_streamreaderprotocol_constructor_without_loop(self):
326- reader = mock.Mock()
327-+ with self.assertWarns(DeprecationWarning) as cm:
328-+ with self.assertRaisesRegex(RuntimeError, 'There is no current event loop'):
329-+ asyncio.StreamReaderProtocol(reader)
330-+ self.assertEqual(cm.warnings[0].filename, __file__)
331-- with self.assertRaisesRegex(RuntimeError, 'no current event loop'):
332-- asyncio.StreamReaderProtocol(reader)
333-334- def test_streamreaderprotocol_constructor_use_running_loop(self):
335- # asyncio issue #184: Ensure that StreamReaderProtocol constructor
336-@@ -786,11 +792,13 @@
337- def test_streamreaderprotocol_constructor_use_global_loop(self):
338- # asyncio issue #184: Ensure that StreamReaderProtocol constructor
339- # retrieves the current loop if the loop parameter is not set
340-+ # Deprecated in 3.10
341-- # Deprecated in 3.10, undeprecated in 3.11.1
342- self.addCleanup(asyncio.set_event_loop, None)
343- asyncio.set_event_loop(self.loop)
344- reader = mock.Mock()
345-+ with self.assertWarns(DeprecationWarning) as cm:
346-+ protocol = asyncio.StreamReaderProtocol(reader)
347-+ self.assertEqual(cm.warnings[0].filename, __file__)
348-- protocol = asyncio.StreamReaderProtocol(reader)
349- self.assertIs(protocol._loop, self.loop)
350-351- def test_multiple_drain(self):
352-reverted:
353---- b/Lib/test/test_asyncio/test_tasks.py
354-+++ a/Lib/test/test_asyncio/test_tasks.py
355-@@ -210,8 +210,10 @@
356-357- a = notmuch()
358- self.addCleanup(a.close)
359-+ with self.assertWarns(DeprecationWarning) as cm:
360-+ with self.assertRaisesRegex(RuntimeError, 'There is no current event loop'):
361-+ asyncio.ensure_future(a)
362-+ self.assertEqual(cm.warnings[0].filename, __file__)
363-- with self.assertRaisesRegex(RuntimeError, 'no current event loop'):
364-- asyncio.ensure_future(a)
365-366- async def test():
367- return asyncio.ensure_future(notmuch())
368-@@ -221,10 +223,12 @@
369- self.assertTrue(t.done())
370- self.assertEqual(t.result(), 'ok')
371-372-+ # Deprecated in 3.10
373-- # Deprecated in 3.10.0, undeprecated in 3.10.9
374- asyncio.set_event_loop(self.loop)
375- self.addCleanup(asyncio.set_event_loop, None)
376-+ with self.assertWarns(DeprecationWarning) as cm:
377-+ t = asyncio.ensure_future(notmuch())
378-+ self.assertEqual(cm.warnings[0].filename, __file__)
379-- t = asyncio.ensure_future(notmuch())
380- self.assertIs(t._loop, self.loop)
381- self.loop.run_until_complete(t)
382- self.assertTrue(t.done())
383-@@ -243,8 +247,10 @@
384-385- a = notmuch()
386- self.addCleanup(a.close)
387-+ with self.assertWarns(DeprecationWarning) as cm:
388-+ with self.assertRaisesRegex(RuntimeError, 'There is no current event loop'):
389-+ asyncio.ensure_future(a)
390-+ self.assertEqual(cm.warnings[0].filename, __file__)
391-- with self.assertRaisesRegex(RuntimeError, 'There is no current event loop'):
392-- asyncio.ensure_future(a)
393-394- async def test():
395- return asyncio.ensure_future(notmuch())
396-@@ -254,10 +260,12 @@
397- self.assertTrue(t.done())
398- self.assertEqual(t.result(), 'ok')
399-400-+ # Deprecated in 3.10
401-- # Deprecated in 3.10.0, undeprecated in 3.10.9
402- asyncio.set_event_loop(self.loop)
403- self.addCleanup(asyncio.set_event_loop, None)
404-+ with self.assertWarns(DeprecationWarning) as cm:
405-+ t = asyncio.ensure_future(notmuch())
406-+ self.assertEqual(cm.warnings[0].filename, __file__)
407-- t = asyncio.ensure_future(notmuch())
408- self.assertIs(t._loop, self.loop)
409- self.loop.run_until_complete(t)
410- self.assertTrue(t.done())
411-@@ -1480,8 +1488,10 @@
412- self.addCleanup(a.close)
413-414- futs = asyncio.as_completed([a])
415-+ with self.assertWarns(DeprecationWarning) as cm:
416-+ with self.assertRaisesRegex(RuntimeError, 'There is no current event loop'):
417-+ list(futs)
418-+ self.assertEqual(cm.warnings[0].filename, __file__)
419-- with self.assertRaisesRegex(RuntimeError, 'no current event loop'):
420-- list(futs)
421-422- def test_as_completed_coroutine_use_running_loop(self):
423- loop = self.new_test_loop()
424-@@ -1497,14 +1507,17 @@
425- loop.run_until_complete(test())
426-427- def test_as_completed_coroutine_use_global_loop(self):
428-+ # Deprecated in 3.10
429-- # Deprecated in 3.10.0, undeprecated in 3.10.9
430- async def coro():
431- return 42
432-433- loop = self.new_test_loop()
434- asyncio.set_event_loop(loop)
435- self.addCleanup(asyncio.set_event_loop, None)
436-+ futs = asyncio.as_completed([coro()])
437-+ with self.assertWarns(DeprecationWarning) as cm:
438-+ futs = list(futs)
439-+ self.assertEqual(cm.warnings[0].filename, __file__)
440-- futs = list(asyncio.as_completed([coro()]))
441- self.assertEqual(len(futs), 1)
442- self.assertEqual(loop.run_until_complete(futs[0]), 42)
443-444-@@ -1974,8 +1987,10 @@
445-446- inner = coro()
447- self.addCleanup(inner.close)
448-+ with self.assertWarns(DeprecationWarning) as cm:
449-+ with self.assertRaisesRegex(RuntimeError, 'There is no current event loop'):
450-+ asyncio.shield(inner)
451-+ self.assertEqual(cm.warnings[0].filename, __file__)
452-- with self.assertRaisesRegex(RuntimeError, 'no current event loop'):
453-- asyncio.shield(inner)
454-455- def test_shield_coroutine_use_running_loop(self):
456- async def coro():
457-@@ -1989,13 +2004,15 @@
458- self.assertEqual(res, 42)
459-460- def test_shield_coroutine_use_global_loop(self):
461-+ # Deprecated in 3.10
462-- # Deprecated in 3.10.0, undeprecated in 3.10.9
463- async def coro():
464- return 42
465-466- asyncio.set_event_loop(self.loop)
467- self.addCleanup(asyncio.set_event_loop, None)
468-+ with self.assertWarns(DeprecationWarning) as cm:
469-+ outer = asyncio.shield(coro())
470-+ self.assertEqual(cm.warnings[0].filename, __file__)
471-- outer = asyncio.shield(coro())
472- self.assertEqual(outer._loop, self.loop)
473- res = self.loop.run_until_complete(outer)
474- self.assertEqual(res, 42)
475-@@ -2933,7 +2950,7 @@
476- self.assertIsNone(asyncio.current_task(loop=self.loop))
477-478- def test_current_task_no_running_loop_implicit(self):
479-+ with self.assertRaises(RuntimeError):
480-- with self.assertRaisesRegex(RuntimeError, 'no running event loop'):
481- asyncio.current_task()
482-483- def test_current_task_with_implicit_loop(self):
484-@@ -3097,8 +3114,10 @@
485- return asyncio.gather(*args, **kwargs)
486-487- def test_constructor_empty_sequence_without_loop(self):
488-+ with self.assertWarns(DeprecationWarning) as cm:
489-+ with self.assertRaises(RuntimeError):
490-+ asyncio.gather()
491-+ self.assertEqual(cm.warnings[0].filename, __file__)
492-- with self.assertRaisesRegex(RuntimeError, 'no current event loop'):
493-- asyncio.gather()
494-495- def test_constructor_empty_sequence_use_running_loop(self):
496- async def gather():
497-@@ -3111,10 +3130,12 @@
498- self.assertEqual(fut.result(), [])
499-500- def test_constructor_empty_sequence_use_global_loop(self):
501-+ # Deprecated in 3.10
502-- # Deprecated in 3.10.0, undeprecated in 3.10.9
503- asyncio.set_event_loop(self.one_loop)
504- self.addCleanup(asyncio.set_event_loop, None)
505-+ with self.assertWarns(DeprecationWarning) as cm:
506-+ fut = asyncio.gather()
507-+ self.assertEqual(cm.warnings[0].filename, __file__)
508-- fut = asyncio.gather()
509- self.assertIsInstance(fut, asyncio.Future)
510- self.assertIs(fut._loop, self.one_loop)
511- self._run_loop(self.one_loop)
512-@@ -3202,8 +3223,10 @@
513- self.addCleanup(gen1.close)
514- gen2 = coro()
515- self.addCleanup(gen2.close)
516-+ with self.assertWarns(DeprecationWarning) as cm:
517-+ with self.assertRaises(RuntimeError):
518-+ asyncio.gather(gen1, gen2)
519-+ self.assertEqual(cm.warnings[0].filename, __file__)
520-- with self.assertRaisesRegex(RuntimeError, 'no current event loop'):
521-- asyncio.gather(gen1, gen2)
522-523- def test_constructor_use_running_loop(self):
524- async def coro():
525-@@ -3217,14 +3240,16 @@
526- self.one_loop.run_until_complete(fut)
527-528- def test_constructor_use_global_loop(self):
529-+ # Deprecated in 3.10
530-- # Deprecated in 3.10.0, undeprecated in 3.10.9
531- async def coro():
532- return 'abc'
533- asyncio.set_event_loop(self.other_loop)
534- self.addCleanup(asyncio.set_event_loop, None)
535- gen1 = coro()
536- gen2 = coro()
537-+ with self.assertWarns(DeprecationWarning) as cm:
538-+ fut = asyncio.gather(gen1, gen2)
539-+ self.assertEqual(cm.warnings[0].filename, __file__)
540-- fut = asyncio.gather(gen1, gen2)
541- self.assertIs(fut._loop, self.other_loop)
542- self.other_loop.run_until_complete(fut)
543-544-reverted:
545---- b/Lib/test/test_asyncio/test_unix_events.py
546-+++ a/Lib/test/test_asyncio/test_unix_events.py
547-@@ -1740,8 +1740,7 @@
548-549- def test_child_watcher_replace_mainloop_existing(self):
550- policy = self.create_policy()
551-+ loop = policy.get_event_loop()
552-- loop = policy.new_event_loop()
553-- policy.set_event_loop(loop)
554-555- # Explicitly setup SafeChildWatcher,
556- # default ThreadedChildWatcher has no _loop property
557-reverted:
558---- b/Lib/test/test_coroutines.py
559-+++ a/Lib/test/test_coroutines.py
560-@@ -2319,8 +2319,7 @@
561- def test_unawaited_warning_during_shutdown(self):
562- code = ("import asyncio\n"
563- "async def f(): pass\n"
564-+ "asyncio.gather(f())\n")
565-- "async def t(): asyncio.gather(f())\n"
566-- "asyncio.run(t())\n")
567- assert_python_ok("-c", code)
568-569- code = ("import sys\n"
570-reverted:
571---- b/Modules/_asynciomodule.c
572-+++ a/Modules/_asynciomodule.c
573-@@ -332,6 +332,13 @@
574- return loop;
575- }
576-577-+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
578-+ "There is no current event loop",
579-+ stacklevel))
580-+ {
581-+ return NULL;
582-+ }
583-+
584- policy = PyObject_CallNoArgs(asyncio_get_event_loop_policy);
585- if (policy == NULL) {
586- return NULL;
587-@@ -3085,11 +3092,6 @@
588- return get_event_loop(1);
589- }
590-591--// This internal method is going away in Python 3.12, left here only for
592--// backwards compatibility with 3.10.0 - 3.10.8 and 3.11.0.
593--// Similarly, this method's Python equivalent in asyncio.events is going
594--// away as well.
595--// See GH-99949 for more details.
596- /*[clinic input]
597- _asyncio._get_event_loop
598- stacklevel: int = 3
···4445let
46 version = "2.38";
47- patchSuffix = "-27";
48 sha256 = "sha256-+4KZiZiyspllRnvBtp0VLpwwfSzzAcnq+0VVt3DvP9I=";
49in
50···60 [
61 /* No tarballs for stable upstream branch, only https://sourceware.org/git/glibc.git and using git would complicate bootstrapping.
62 $ git fetch --all -p && git checkout origin/release/2.38/master && git describe
63- glibc-2.38-27-g750a45a783
64 $ git show --minimal --reverse glibc-2.38.. | gzip -9n --rsyncable - > 2.38-master.patch.gz
6566 To compare the archive contents zdiff can be used.
···96 & https://github.com/NixOS/nixpkgs/pull/188492#issuecomment-1233802991
97 */
98 ./reenable_DT_HASH.patch
0000099 ]
100 /* NVCC does not support ARM intrinsics. Since <math.h> is pulled in by almost
101 every HPC piece of software, without this patch CUDA compilation on ARM
···155 # and on aarch64 with binutils 2.30 or later.
156 # https://sourceware.org/glibc/wiki/PortStatus
157 "--enable-static-pie"
158- ] ++ lib.optionals stdenv.hostPlatform.isx86 [
159 # Enable Intel Control-flow Enforcement Technology (CET) support
160 "--enable-cet"
161 ] ++ lib.optionals withLinuxHeaders [
···4445let
46 version = "2.38";
47+ patchSuffix = "-44";
48 sha256 = "sha256-+4KZiZiyspllRnvBtp0VLpwwfSzzAcnq+0VVt3DvP9I=";
49in
50···60 [
61 /* No tarballs for stable upstream branch, only https://sourceware.org/git/glibc.git and using git would complicate bootstrapping.
62 $ git fetch --all -p && git checkout origin/release/2.38/master && git describe
63+ glibc-2.38-44-gd37c2b20a4
64 $ git show --minimal --reverse glibc-2.38.. | gzip -9n --rsyncable - > 2.38-master.patch.gz
6566 To compare the archive contents zdiff can be used.
···96 & https://github.com/NixOS/nixpkgs/pull/188492#issuecomment-1233802991
97 */
98 ./reenable_DT_HASH.patch
99+100+ /* Retrieved from https://salsa.debian.org/glibc-team/glibc/-/commit/662dbc4f9287139a0d9c91df328a5ba6cc6abee1#0f3c6d67cb8cf5bb35c421c20f828fea97b68edf
101+ Qualys advisory: https://www.qualys.com/2024/01/30/qsort.txt
102+ */
103+ ./local-qsort-memory-corruption.patch
104 ]
105 /* NVCC does not support ARM intrinsics. Since <math.h> is pulled in by almost
106 every HPC piece of software, without this patch CUDA compilation on ARM
···160 # and on aarch64 with binutils 2.30 or later.
161 # https://sourceware.org/glibc/wiki/PortStatus
162 "--enable-static-pie"
163+ ] ++ lib.optionals stdenv.hostPlatform.isx86_64 [
164 # Enable Intel Control-flow Enforcement Technology (CET) support
165 "--enable-cet"
166 ] ++ lib.optionals withLinuxHeaders [
···69 "fs_event_watch_dir_recursive" "fs_event_watch_file"
70 "fs_event_watch_file_current_dir" "fs_event_watch_file_exact_path"
71 "process_priority" "udp_create_early_bad_bind"
00072 ] ++ lib.optionals stdenv.isAarch32 [
73 # I observe this test failing with some regularity on ARMv7:
74 # https://github.com/libuv/libuv/issues/1871
···69 "fs_event_watch_dir_recursive" "fs_event_watch_file"
70 "fs_event_watch_file_current_dir" "fs_event_watch_file_exact_path"
71 "process_priority" "udp_create_early_bad_bind"
72+ ] ++ lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
73+ # fail on macos < 10.15 (starting in libuv 1.47.0)
74+ "fs_write_alotof_bufs_with_offset" "fs_write_multiple_bufs" "fs_read_bufs"
75 ] ++ lib.optionals stdenv.isAarch32 [
76 # I observe this test failing with some regularity on ARMv7:
77 # https://github.com/libuv/libuv/issues/1871
···1{ lib
2, stdenv
3, fetchFromGitLab
4+, fetchurl
5, darwin
6, abseil-cpp
7, meson
···20 rev = "v${version}";
21 hash = "sha256-8CDt4kMt2Owzyv22dqWIcFuHeg4Y3FxB405cLw3FZ+g=";
22 };
23+24+ patches = [
25+ # Fix an include oppsie that happens to not happen on glibc
26+ # https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/merge_requests/38
27+ (fetchurl {
28+ url = "https://git.alpinelinux.org/aports/plain/community/webrtc-audio-processing-1/0001-rtc_base-Include-stdint.h-to-fix-build-failures.patch?id=625e19c19972e69e034c0870a31b375833d1ab5d";
29+ hash = "sha256-9nI22SJoU0H3CzsPSAObtCFTadtvkzdnqIh6mxmUuds=";
30+ })
31+ ];
3233 outputs = [ "out" "dev" ];
34
+8-3
pkgs/development/libraries/zlib/default.nix
···9# If false, and if `{ static = true; }`, the .a stays in the main output.
10, splitStaticOutput ? shared && static
11, testers
012}:
1314# Without either the build will actually still succeed because the build
···2425stdenv.mkDerivation (finalAttrs: {
26 pname = "zlib";
27- version = "1.3";
2829 src = let
30 inherit (finalAttrs) version;
···35 # Stable archive path, but captcha can be encountered, causing hash mismatch.
36 "https://www.zlib.net/fossils/zlib-${version}.tar.gz"
37 ];
38- hash = "sha256-/wukwpIBPbwnUws6geH5qBPNOd4Byl4Pi/NVcC76WT4=";
39 };
4041 postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
···128 "SHARED_MODE=1"
129 ];
130131- passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
0000132133 meta = with lib; {
134 homepage = "https://zlib.net";
···9# If false, and if `{ static = true; }`, the .a stays in the main output.
10, splitStaticOutput ? shared && static
11, testers
12+, minizip
13}:
1415# Without either the build will actually still succeed because the build
···2526stdenv.mkDerivation (finalAttrs: {
27 pname = "zlib";
28+ version = "1.3.1";
2930 src = let
31 inherit (finalAttrs) version;
···36 # Stable archive path, but captcha can be encountered, causing hash mismatch.
37 "https://www.zlib.net/fossils/zlib-${version}.tar.gz"
38 ];
39+ hash = "sha256-mpOyt9/ax3zrpaVYpYDnRmfdb+3kWFuR7vtg8Dty3yM=";
40 };
4142 postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
···129 "SHARED_MODE=1"
130 ];
131132+ passthru.tests = {
133+ pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
134+ # uses `zlib` derivation:
135+ inherit minizip;
136+ };
137138 meta = with lib; {
139 homepage = "https://zlib.net";
+3
pkgs/development/misc/resholve/oildev.nix
···120 rm cpp/stdlib.h # keep modules from finding the wrong stdlib?
121 # work around hard parse failure documented in oilshell/oil#1468
122 substituteInPlace osh/cmd_parse.py --replace 'elif self.c_id == Id.Op_LParen' 'elif False'
000123 '';
124125 # See earlier note on glibcLocales TODO: verify needed?
···120 rm cpp/stdlib.h # keep modules from finding the wrong stdlib?
121 # work around hard parse failure documented in oilshell/oil#1468
122 substituteInPlace osh/cmd_parse.py --replace 'elif self.c_id == Id.Op_LParen' 'elif False'
123+ '' + lib.optionalString (!stdenv.hostPlatform.isGnu && !stdenv.hostPlatform.isDarwin) ''
124+ # disable fragile libc tests
125+ substituteInPlace build/py.sh --replace "py-ext-test pyext/libc_test.py" "#py-ext-test pyext/libc_test.py"
126 '';
127128 # See earlier note on glibcLocales TODO: verify needed?
···22 description = "Matplotlib utilities for the visualization, and visual analysis, of financial data";
23 homepage = "https://github.com/matplotlib/mplfinance";
24 license = [ licenses.bsd3 ];
25- maintainers = [ maintainers.ehmry ];
26 };
27}
···22 description = "Matplotlib utilities for the visualization, and visual analysis, of financial data";
23 homepage = "https://github.com/matplotlib/mplfinance";
24 license = [ licenses.bsd3 ];
025 };
26}
+1-1
pkgs/development/python-modules/numpy/default.nix
···114115 # we default openblas to build with 64 threads
116 # if a machine has more than 64 threads, it will segfault
117- # see https://github.com/xianyi/OpenBLAS/issues/2993
118 preConfigure = ''
119 sed -i 's/-faltivec//' numpy/distutils/system_info.py
120 export OMP_NUM_THREADS=$((NIX_BUILD_CORES > 64 ? 64 : NIX_BUILD_CORES))
···114115 # we default openblas to build with 64 threads
116 # if a machine has more than 64 threads, it will segfault
117+ # see https://github.com/OpenMathLib/OpenBLAS/issues/2993
118 preConfigure = ''
119 sed -i 's/-faltivec//' numpy/distutils/system_info.py
120 export OMP_NUM_THREADS=$((NIX_BUILD_CORES > 64 ? 64 : NIX_BUILD_CORES))
···10, pytest-mock
11}:
1213+let self = buildPythonPackage rec {
14 pname = "pydantic-settings";
15 version = "2.1.0";
16 pyproject = true;
···50 export HOME=$TMPDIR
51 '';
5253+ # ruff is a dependency of pytest-examples which is required to run the tests.
54+ # We do not want all of the downstream packages that depend on pydantic-settings to also depend on ruff.
55+ doCheck = false;
56+ passthru.tests = {
57+ pytest = self.overridePythonAttrs {
58+ doCheck = true;
59+ };
60+ };
61+62 meta = with lib; {
63 description = "Settings management using pydantic";
64 homepage = "https://github.com/pydantic/pydantic-settings";
···66 broken = lib.versionOlder pydantic.version "2.0.0";
67 maintainers = with maintainers; [ ];
68 };
69+}; in self
···76 "doc/source/dev/contributor/meson_advanced.rst"
77 ];
78 })
0000079 ];
8081 # Upstream complicated numpy version pinning is causing issues in the
···76 "doc/source/dev/contributor/meson_advanced.rst"
77 ];
78 })
79+ (fetchpatch {
80+ name = "openblas-0.3.26-compat.patch";
81+ url = "https://github.com/scipy/scipy/commit/8c96a1f742335bca283aae418763aaba62c03378.patch";
82+ hash = "sha256-SGoYDxwSAkr6D5/XEqHLerF4e4nmmI+PX+z+3taWAps=";
83+ })
84 ];
8586 # Upstream complicated numpy version pinning is causing issues in the
···5, stdenv
6, darwin
7, rust-jemalloc-sys
08, ruff-lsp
9}:
1011rustPlatform.buildRustPackage rec {
12 pname = "ruff";
13+ version = "0.1.15";
1415 src = fetchFromGitHub {
16 owner = "astral-sh";
17 repo = "ruff";
18 rev = "refs/tags/v${version}";
19+ hash = "sha256-DzdzMO9PEwf4HmpG8SxRJTmdrmkXuQ8RsIchvsKstH8=";
20 };
2122+ # The following specific substitution is not working as the current directory is `/build/source` and thus has no mention of `ruff` in it.
23+ # https://github.com/astral-sh/ruff/blob/866bea60a5de3c59d2537b0f3a634ae0ac9afd94/crates/ruff/tests/show_settings.rs#L12
24+ # -> Just patch it so that it expects the actual current directory and not `"[BASEPATH]"`.
25+ postPatch = ''
26+ substituteInPlace crates/ruff/tests/snapshots/show_settings__display_default_settings.snap \
27+ --replace '"[BASEPATH]"' '"'$PWD'"'
28+ '';
29+30+ cargoHash = "sha256-MpiWdNUs66OGYfOJo1kJQTCqjrk/DAYecaLf6GUUKew=";
3132 nativeBuildInputs = [
33 installShellFiles
···38 ] ++ lib.optionals stdenv.isDarwin [
39 darwin.apple_sdk.frameworks.CoreServices
40 ];
0004142 # tests expect no colors
43 preCheck = ''
···1718stdenv.mkDerivation rec {
19 pname = "kbd";
20- version = "2.6.3";
2122 src = fetchurl {
23 url = "mirror://kernel/linux/utils/kbd/${pname}-${version}.tar.xz";
24- sha256 = "sha256-BJlsCNfRxGCWb7JEo9OIM1LCZ0t61SIAPZ9Oy4q0jes=";
25 };
2627 # vlock is moved into its own output, since it depends on pam. This
···1718stdenv.mkDerivation rec {
19 pname = "kbd";
20+ version = "2.6.4";
2122 src = fetchurl {
23 url = "mirror://kernel/linux/utils/kbd/${pname}-${version}.tar.xz";
24+ sha256 = "sha256-UZ+NCHrsyn4KM80IS++SwGbrGXMWZmU9zHDJ1xqkCSY=";
25 };
2627 # vlock is moved into its own output, since it depends on pam. This
+2-2
pkgs/os-specific/linux/kernel-headers/default.nix
···111in {
112 inherit makeLinuxHeaders;
113114- linuxHeaders = let version = "6.6"; in
115 makeLinuxHeaders {
116 inherit version;
117 src = fetchurl {
118 url = "mirror://kernel/linux/kernel/v${lib.versions.major version}.x/linux-${version}.tar.xz";
119- hash = "sha256-2SagbGPdisffP4buH/ws4qO4Gi0WhITna1s4mrqOVtA=";
120 };
121 patches = [
122 ./no-relocs.patch # for building x86 kernel headers on non-ELF platforms
···111in {
112 inherit makeLinuxHeaders;
113114+ linuxHeaders = let version = "6.7"; in
115 makeLinuxHeaders {
116 inherit version;
117 src = fetchurl {
118 url = "mirror://kernel/linux/kernel/v${lib.versions.major version}.x/linux-${version}.tar.xz";
119+ hash = "sha256-7zEUSiV20IDYwxaY6D7J9mv5fGd/oqrw1bu58zRbEGk=";
120 };
121 patches = [
122 ./no-relocs.patch # for building x86 kernel headers on non-ELF platforms
+4-4
pkgs/os-specific/linux/kernel/xanmod-kernels.nix
···6 # NOTE: When updating these, please also take a look at the changes done to
7 # kernel config in the xanmod version commit
8 ltsVariant = {
9- version = "6.1.74";
10- hash = "sha256-PqCojvh7JwTcavtQHB8l/WxCTg94ndOy9KGVXsmGO/Y=";
11 variant = "lts";
12 };
1314 mainVariant = {
15- version = "6.6.13";
16- hash = "sha256-RTfa9eIGYDqnffFnOFNaghKoGcHVy4rGYQkYumcw6Tk=";
17 variant = "main";
18 };
19
···6 # NOTE: When updating these, please also take a look at the changes done to
7 # kernel config in the xanmod version commit
8 ltsVariant = {
9+ version = "6.1.76";
10+ hash = "sha256-0nBdUFRGMWM3IL/q8CYiDEUA/sIrYPMkzsBQen30o2E=";
11 variant = "lts";
12 };
1314 mainVariant = {
15+ version = "6.6.15";
16+ hash = "sha256-KHn4Ntm1QStgJRWzwmPYXEbEcuZcF4pWJ964wc6J2Wk=";
17 variant = "main";
18 };
19
···68, libpwquality
69, qrencode
7071- # the (optional) BPF feature requires bpftool, libbpf, clang and llvm-strip to be available during build time.
072 # Only libbpf should be a runtime dependency.
73 # Note: llvmPackages is explicitly taken from buildPackages instead of relying
74 # on splicing. Splicing will evaluate the adjacent (pkgsHostTarget) llvmPackages
75 # which is sometimes problematic: llvmPackages.clang looks at targetPackages.stdenv.cc
76- # which, in the unfortunate case of pkgsCross.ghcjs, `throw`s. If we explicitly
77- # take buildPackages.llvmPackages, this is no problem because
78- # `buildPackages.targetPackages.stdenv.cc == stdenv.cc` relative to us. Working
79- # around this is important, because systemd is in the dependency closure of
80- # GHC via emscripten and jdk.
81, bpftools
82, libbpf
83···93 && !stdenv.hostPlatform.isMusl
94 # "Unknown 64-bit data model"
95 && !stdenv.hostPlatform.isRiscV32
96-, withCompression ? true # adds bzip2, lz4, xz and zstd
097, withCoredump ? true
98, withCryptsetup ? true
99, withRepart ? true
100, withDocumentation ? true
101, withEfi ? stdenv.hostPlatform.isEfi
102, withFido2 ? true
103-, withFirstboot ? false # conflicts with the NixOS /etc management
0104, withHomed ? !stdenv.hostPlatform.isMusl
105, withHostnamed ? true
106, withHwdb ? true
···108, withIptables ? true
109, withKmod ? true
110, withLibBPF ? lib.versionAtLeast buildPackages.llvmPackages.clang.version "10.0"
111- && (stdenv.hostPlatform.isAarch -> lib.versionAtLeast stdenv.hostPlatform.parsed.cpu.version "6") # assumes hard floats
112- && !stdenv.hostPlatform.isMips64 # see https://github.com/NixOS/nixpkgs/pull/194149#issuecomment-1266642211
00113 # can't find gnu/stubs-32.h
114 && (stdenv.hostPlatform.isPower64 -> stdenv.hostPlatform.isBigEndian)
115 # https://reviews.llvm.org/D43106#1019077
···139, withTimedated ? true
140, withTimesyncd ? true
141, withTpm2Tss ? true
142-, withUkify ? false # adds python to closure which is too much by default
0143, withUserDb ? true
144, withUtmp ? !stdenv.hostPlatform.isMusl
145, withVmspawn ? true
···148 # build only libudev and libsystemd
149, buildLibsOnly ? false
150151- # name argument
152, pname ? "systemd"
153154, libxslt
···171 wantGcrypt = withResolved || withImportd;
172 version = "255.2";
173174- # Bump this variable on every (major) version change. See below (in the meson options list) for why.
0175 # command:
176 # $ curl -s https://api.github.com/repos/systemd/systemd/releases/latest | \
177 # jq '.created_at|strptime("%Y-%m-%dT%H:%M:%SZ")|mktime'
···189 hash = "sha256-8SfJY/pcH4yrDeJi0GfIUpetTbpMwyswvSu+RSfgqfY=";
190 };
191192- # On major changes, or when otherwise required, you *must* reformat the patches,
193- # `git am path/to/00*.patch` them into a systemd worktree, rebase to the more recent
194- # systemd version, and export the patches again via
195- # `git -c format.signoff=false format-patch v${version} --no-numbered --zero-commit --no-signature`.
196- # Use `find . -name "*.patch" | sort` to get an up-to-date listing of all patches
000197 patches = [
198 ./0001-Start-device-units-for-uninitialised-encrypted-devic.patch
199 ./0002-Don-t-try-to-unmount-nix-or-nix-store.patch
···262 "$out/lib/systemd/boot/efi"
263 '' + (
264 let
265- # The following patches references to dynamic libraries to ensure that
266- # all the features that are implemented via dlopen(3) are available (or
267 # explicitly deactivated) by pointing dlopen to the absolute store path
268 # instead of relying on the linkers runtime lookup code.
269 #
···275 # found` when using e.g. --grep with journalctl. Those errors should
276 # become less unexpected now.
277 #
278- # There are generally two classes of dlopen(3) calls. Those that we want to
279- # support and those that should be deactivated / unsupported. This change
280- # enforces that we handle all dlopen calls explicitly. Meaning: There is
281- # not a single dlopen call in the source code tree that we did not
282- # explicitly handle.
283 #
284 # In order to do this we introduced a list of attributes that maps from
285 # shared object name to the package that contains them. The package can be
···288 # path location).
289 #
290 # To get a list of dynamically loaded libraries issue something like
291- # `grep -ri '"lib[a-zA-Z0-9-]*\.so[\.0-9a-zA-z]*"'' $src` and update the below list.
0292 dlopenLibs =
293 let
294 opt = condition: pkg: if condition then pkg else null;
···374 # patch all the dlopen calls to contain absolute paths to the libraries
375 lib.concatMapStringsSep "\n" patchDlOpen dlopenLibs
376 )
377- # finally ensure that there are no left-over dlopen calls (or rather strings pointing to shared libraries) that we didn't handle
0378 + ''
379 if grep -qr '"lib[a-zA-Z0-9-]*\.so[\.0-9a-zA-z]*"' src; then
380 echo "Found unhandled dynamic library calls: "
···461 mesonFlags = [
462 # Options
463464- # We bump this variable on every (major) version change to ensure
465- # that we have known-good value for a timestamp that is in the (not so distant) past.
466- # This serves as a lower bound for valid system timestamps during startup. Systemd will
467- # reset the system timestamp if this date is +- 15 years from the system time.
0468 # See the systemd v250 release notes for further details:
469- # https://github.com/systemd/systemd/blob/60e930fc3e6eb8a36fbc184773119eb8d2f30364/NEWS#L258-L266
470 (lib.mesonOption "time-epoch" releaseTimestamp)
471472 (lib.mesonOption "version-tag" version)
···616 ];
617 preConfigure =
618 let
619- # A list of all the runtime binaries that the systemd executables, tests and libraries are referencing in their source code, scripts and unit files.
620- # As soon as a dependency isn't required anymore we should remove it from the list. The `where` attribute for each of the replacement patterns must be exhaustive. If another (unhandled) case is found in the source code the build fails with an error message.
00000621 binaryReplacements = [
622- { search = "/usr/bin/getent"; replacement = "${getent}/bin/getent"; where = [ "src/nspawn/nspawn-setuid.c" ]; }
623-000624 {
625 search = "/sbin/mkswap";
626 replacement = "${lib.getBin util-linux}/sbin/mkswap";
···628 "man/systemd-makefs@.service.xml"
629 ];
630 }
631- { search = "/sbin/swapon"; replacement = "${lib.getOutput "swap" util-linux}/sbin/swapon"; where = [ "src/core/swap.c" "src/basic/unit-def.h" ]; }
632- { search = "/sbin/swapoff"; replacement = "${lib.getOutput "swap" util-linux}/sbin/swapoff"; where = [ "src/core/swap.c" ]; }
00000000000633 {
634 search = "/bin/echo";
635 replacement = "${coreutils}/bin/echo";
···646 {
647 search = "/bin/cat";
648 replacement = "${coreutils}/bin/cat";
649- where = [ "test/test-execute/exec-noexecpaths-simple.service" "src/journal/cat.c" ];
000650 }
651 {
652 search = "/usr/lib/systemd/systemd-fsck";
653 replacement = "$out/lib/systemd/systemd-fsck";
654- where = [
655- "man/systemd-fsck@.service.xml"
656- ];
657 }
658 ] ++ lib.optionals withImportd [
659 {
···682 ];
683 }
684 ] ++ lib.optionals withKmod [
685- { search = "/sbin/modprobe"; replacement = "${lib.getBin kmod}/sbin/modprobe"; where = [ "units/modprobe@.service" ]; }
0000686 ];
687688- # { replacement, search, where } -> List[str]
689 mkSubstitute = { replacement, search, where, ignore ? [ ] }:
690 map (path: "substituteInPlace ${path} --replace '${search}' \"${replacement}\"") where;
691 mkEnsureSubstituted = { replacement, search, where, ignore ? [ ] }:
···778 mv $out/lib/sysusers.d $out/example
779 '';
780781- # Avoid *.EFI binary stripping. At least on aarch64-linux strip
782- # removes too much from PE32+ files:
783 # https://github.com/NixOS/nixpkgs/issues/169693
784- # The hack is to move EFI file out of lib/ before doStrip
785- # run and return it after doStrip run.
786 preFixup = lib.optionalString withBootloader ''
787 mv $out/lib/systemd/boot/efi $out/dont-strip-me
788 '';
···807 (builtins.map (p: p.__spliced.buildHost or p) finalAttrs.nativeBuildInputs);
808809 passthru = {
810- # The interface version prevents NixOS from switching to an
811- # incompatible systemd at runtime. (Switching across reboots is
812- # fine, of course.) It should be increased whenever systemd changes
813- # in a backwards-incompatible way. If the interface version of two
814- # systemd builds is the same, then we can switch between them at
815- # runtime; otherwise we can't and we need to reboot.
816 interfaceVersion = 2;
817818- inherit withCryptsetup withHostnamed withImportd withKmod withLocaled withMachined withPortabled withTimedated withUtmp util-linux kmod kbd;
0819820 tests = {
821 inherit (nixosTests)
···823 systemd-journal
824 systemd-journal-gateway
825 systemd-journal-upload;
826- cross = pkgsCross.${if stdenv.buildPlatform.isAarch64 then "gnu64" else "aarch64-multiplatform"}.systemd;
0000000827 };
828 };
829830- meta = with lib; {
831 homepage = "https://www.freedesktop.org/wiki/Software/systemd/";
832 description = "A system and service manager for Linux";
833- license = licenses.lgpl21Plus;
834- platforms = platforms.linux;
00000000000000000000000000000835 badPlatforms = [ lib.systems.inspect.platformPatterns.isStatic ];
836 # https://github.com/systemd/systemd/issues/20600#issuecomment-912338965
837 broken = stdenv.hostPlatform.isStatic;
838- priority = 10;
839- maintainers = with maintainers; [ flokli kloenk ];
840 };
841})
···68, libpwquality
69, qrencode
7071+ # the (optional) BPF feature requires bpftool, libbpf, clang and llvm-strip to
72+ # be available during build time.
73 # Only libbpf should be a runtime dependency.
74 # Note: llvmPackages is explicitly taken from buildPackages instead of relying
75 # on splicing. Splicing will evaluate the adjacent (pkgsHostTarget) llvmPackages
76 # which is sometimes problematic: llvmPackages.clang looks at targetPackages.stdenv.cc
77+ # which, in the unfortunate case of pkgsCross.ghcjs, `throw`s. If we
78+ # explicitly take buildPackages.llvmPackages, this is no problem because
79+ # `buildPackages.targetPackages.stdenv.cc == stdenv.cc` relative to
80+ # us. Working around this is important, because systemd is in the dependency
81+ # closure of GHC via emscripten and jdk.
82, bpftools
83, libbpf
84···94 && !stdenv.hostPlatform.isMusl
95 # "Unknown 64-bit data model"
96 && !stdenv.hostPlatform.isRiscV32
97+ # adds bzip2, lz4, xz and zstd
98+, withCompression ? true
99, withCoredump ? true
100, withCryptsetup ? true
101, withRepart ? true
102, withDocumentation ? true
103, withEfi ? stdenv.hostPlatform.isEfi
104, withFido2 ? true
105+ # conflicts with the NixOS /etc management
106+, withFirstboot ? false
107, withHomed ? !stdenv.hostPlatform.isMusl
108, withHostnamed ? true
109, withHwdb ? true
···111, withIptables ? true
112, withKmod ? true
113, withLibBPF ? lib.versionAtLeast buildPackages.llvmPackages.clang.version "10.0"
114+ # assumes hard floats
115+ && (stdenv.hostPlatform.isAarch -> lib.versionAtLeast stdenv.hostPlatform.parsed.cpu.version "6")
116+ # see https://github.com/NixOS/nixpkgs/pull/194149#issuecomment-1266642211
117+ && !stdenv.hostPlatform.isMips64
118 # can't find gnu/stubs-32.h
119 && (stdenv.hostPlatform.isPower64 -> stdenv.hostPlatform.isBigEndian)
120 # https://reviews.llvm.org/D43106#1019077
···144, withTimedated ? true
145, withTimesyncd ? true
146, withTpm2Tss ? true
147+ # adds python to closure which is too much by default
148+, withUkify ? false
149, withUserDb ? true
150, withUtmp ? !stdenv.hostPlatform.isMusl
151, withVmspawn ? true
···154 # build only libudev and libsystemd
155, buildLibsOnly ? false
156157+ # yes, pname is an argument here
158, pname ? "systemd"
159160, libxslt
···177 wantGcrypt = withResolved || withImportd;
178 version = "255.2";
179180+ # Use the command below to update `releaseTimestamp` on every (major) version
181+ # change. More details in the commentary at mesonFlags.
182 # command:
183 # $ curl -s https://api.github.com/repos/systemd/systemd/releases/latest | \
184 # jq '.created_at|strptime("%Y-%m-%dT%H:%M:%SZ")|mktime'
···196 hash = "sha256-8SfJY/pcH4yrDeJi0GfIUpetTbpMwyswvSu+RSfgqfY=";
197 };
198199+ # On major changes, or when otherwise required, you *must* :
200+ # 1. reformat the patches,
201+ # 2. `git am path/to/00*.patch` them into a systemd worktree,
202+ # 3. rebase to the more recent systemd version,
203+ # 4. and export the patches again via
204+ # `git -c format.signoff=false format-patch v${version} --no-numbered --zero-commit --no-signature`.
205+ # Use `find . -name "*.patch" | sort` to get an up-to-date listing of all
206+ # patches
207 patches = [
208 ./0001-Start-device-units-for-uninitialised-encrypted-devic.patch
209 ./0002-Don-t-try-to-unmount-nix-or-nix-store.patch
···272 "$out/lib/systemd/boot/efi"
273 '' + (
274 let
275+ # The following patches references to dynamic libraries to ensure that all
276+ # the features that are implemented via dlopen(3) are available (or
277 # explicitly deactivated) by pointing dlopen to the absolute store path
278 # instead of relying on the linkers runtime lookup code.
279 #
···285 # found` when using e.g. --grep with journalctl. Those errors should
286 # become less unexpected now.
287 #
288+ # There are generally two classes of dlopen(3) calls. Those that we want
289+ # to support and those that should be deactivated / unsupported. This
290+ # change enforces that we handle all dlopen calls explicitly. Meaning:
291+ # There is not a single dlopen call in the source code tree that we did
292+ # not explicitly handle.
293 #
294 # In order to do this we introduced a list of attributes that maps from
295 # shared object name to the package that contains them. The package can be
···298 # path location).
299 #
300 # To get a list of dynamically loaded libraries issue something like
301+ # `grep -ri '"lib[a-zA-Z0-9-]*\.so[\.0-9a-zA-z]*"'' $src`
302+ # and update the list below.
303 dlopenLibs =
304 let
305 opt = condition: pkg: if condition then pkg else null;
···385 # patch all the dlopen calls to contain absolute paths to the libraries
386 lib.concatMapStringsSep "\n" patchDlOpen dlopenLibs
387 )
388+ # finally ensure that there are no left-over dlopen calls (or rather strings
389+ # pointing to shared libraries) that we didn't handle
390 + ''
391 if grep -qr '"lib[a-zA-Z0-9-]*\.so[\.0-9a-zA-z]*"' src; then
392 echo "Found unhandled dynamic library calls: "
···473 mesonFlags = [
474 # Options
475476+ # We bump this attribute on every (major) version change to ensure that we
477+ # have known-good value for a timestamp that is in the (not so distant)
478+ # past. This serves as a lower bound for valid system timestamps during
479+ # startup. Systemd will reset the system timestamp if this date is +- 15
480+ # years from the system time.
481 # See the systemd v250 release notes for further details:
482+ # https://github.com/systemd/systemd/blob/60e930fc3e6eb8a36fbc184773119eb8d2f30364/NEWS#L258-L266
483 (lib.mesonOption "time-epoch" releaseTimestamp)
484485 (lib.mesonOption "version-tag" version)
···629 ];
630 preConfigure =
631 let
632+ # A list of all the runtime binaries referenced by the source code (plus
633+ # scripts and unit files) of systemd executables, tests and libraries.
634+ # As soon as a dependency is lo longer required we should remove it from
635+ # the list.
636+ # The `where` attribute for each of the replacement patterns must be
637+ # exhaustive. If another (unhandled) case is found in the source code the
638+ # build fails with an error message.
639 binaryReplacements = [
640+ {
641+ search = "/usr/bin/getent";
642+ replacement = "${getent}/bin/getent";
643+ where = [ "src/nspawn/nspawn-setuid.c" ];
644+ }
645 {
646 search = "/sbin/mkswap";
647 replacement = "${lib.getBin util-linux}/sbin/mkswap";
···649 "man/systemd-makefs@.service.xml"
650 ];
651 }
652+ {
653+ search = "/sbin/swapon";
654+ replacement = "${lib.getOutput "swap" util-linux}/sbin/swapon";
655+ where = [
656+ "src/core/swap.c"
657+ "src/basic/unit-def.h"
658+ ];
659+ }
660+ {
661+ search = "/sbin/swapoff";
662+ replacement = "${lib.getOutput "swap" util-linux}/sbin/swapoff";
663+ where = [ "src/core/swap.c" ];
664+ }
665 {
666 search = "/bin/echo";
667 replacement = "${coreutils}/bin/echo";
···678 {
679 search = "/bin/cat";
680 replacement = "${coreutils}/bin/cat";
681+ where = [
682+ "test/test-execute/exec-noexecpaths-simple.service"
683+ "src/journal/cat.c"
684+ ];
685 }
686 {
687 search = "/usr/lib/systemd/systemd-fsck";
688 replacement = "$out/lib/systemd/systemd-fsck";
689+ where = [ "man/systemd-fsck@.service.xml" ];
00690 }
691 ] ++ lib.optionals withImportd [
692 {
···715 ];
716 }
717 ] ++ lib.optionals withKmod [
718+ {
719+ search = "/sbin/modprobe";
720+ replacement = "${lib.getBin kmod}/sbin/modprobe";
721+ where = [ "units/modprobe@.service" ];
722+ }
723 ];
724725+ # { replacement, search, where, ignore } -> List[str]
726 mkSubstitute = { replacement, search, where, ignore ? [ ] }:
727 map (path: "substituteInPlace ${path} --replace '${search}' \"${replacement}\"") where;
728 mkEnsureSubstituted = { replacement, search, where, ignore ? [ ] }:
···815 mv $out/lib/sysusers.d $out/example
816 '';
817818+ # Avoid *.EFI binary stripping.
819+ # At least on aarch64-linux strip removes too much from PE32+ files:
820 # https://github.com/NixOS/nixpkgs/issues/169693
821+ # The hack is to move EFI file out of lib/ before doStrip run and return it
822+ # after doStrip run.
823 preFixup = lib.optionalString withBootloader ''
824 mv $out/lib/systemd/boot/efi $out/dont-strip-me
825 '';
···844 (builtins.map (p: p.__spliced.buildHost or p) finalAttrs.nativeBuildInputs);
845846 passthru = {
847+ # The `interfaceVersion` attribute below points out the incompatibilities
848+ # between systemd versions. When the new systemd build is
849+ # backwards-compatible with the previous one, then they can be switched at
850+ # runtime (the reboot being optional in this case); otherwise, a reboot is
851+ # needed - and therefore `interfaceVersion` should be incremented.
0852 interfaceVersion = 2;
853854+ inherit withCryptsetup withHostnamed withImportd withKmod withLocaled
855+ withMachined withPortabled withTimedated withUtmp util-linux kmod kbd;
856857 tests = {
858 inherit (nixosTests)
···860 systemd-journal
861 systemd-journal-gateway
862 systemd-journal-upload;
863+ cross =
864+ let
865+ systemString =
866+ if stdenv.buildPlatform.isAarch64
867+ then "gnu64"
868+ else "aarch64-multiplatform";
869+ in
870+ pkgsCross.${systemString}.systemd;
871 };
872 };
873874+ meta = {
875 homepage = "https://www.freedesktop.org/wiki/Software/systemd/";
876 description = "A system and service manager for Linux";
877+ longDescription = ''
878+ systemd is a suite of basic building blocks for a Linux system. It
879+ provides a system and service manager that runs as PID 1 and starts the
880+ rest of the system. systemd provides aggressive parallelization
881+ capabilities, uses socket and D-Bus activation for starting services,
882+ offers on-demand starting of daemons, keeps track of processes using Linux
883+ control groups, maintains mount and automount points, and implements an
884+ elaborate transactional dependency-based service control logic. systemd
885+ supports SysV and LSB init scripts and works as a replacement for
886+ sysvinit. Other parts include a logging daemon, utilities to control basic
887+ system configuration like the hostname, date, locale, maintain a list of
888+ logged-in users and running containers and virtual machines, system
889+ accounts, runtime directories and settings, and daemons to manage simple
890+ network configuration, network time synchronization, log forwarding, and
891+ name resolution.
892+ '';
893+ license = with lib.licenses; [
894+ # Taken from https://raw.githubusercontent.com/systemd/systemd-stable/${finalAttrs.src.rev}/LICENSES/README.md
895+ bsd2
896+ bsd3
897+ cc0
898+ lgpl21Plus
899+ lgpl2Plus
900+ mit
901+ mit0
902+ ofl
903+ publicDomain
904+ ];
905+ maintainers = with lib.maintainers; [ flokli kloenk ];
906+ platforms = lib.platforms.linux;
907+ priority = 10;
908 badPlatforms = [ lib.systems.inspect.platformPatterns.isStatic ];
909 # https://github.com/systemd/systemd/issues/20600#issuecomment-912338965
910 broken = stdenv.hostPlatform.isStatic;
00911 };
912})
+1-1
pkgs/servers/mpd/default.nix
···188 description = "A flexible, powerful daemon for playing music";
189 homepage = "https://www.musicpd.org/";
190 license = licenses.gpl2Only;
191- maintainers = with maintainers; [ astsmtl ehmry tobim ];
192 platforms = platforms.unix;
193 mainProgram = "mpd";
194
···188 description = "A flexible, powerful daemon for playing music";
189 homepage = "https://www.musicpd.org/";
190 license = licenses.gpl2Only;
191+ maintainers = with maintainers; [ astsmtl tobim ];
192 platforms = platforms.unix;
193 mainProgram = "mpd";
194
···22in
23perlPackages.buildPerlPackage rec {
24 pname = "slimserver";
25- version = "8.3.1";
2627 src = fetchFromGitHub {
28 owner = "Logitech";
29 repo = "slimserver";
30 rev = version;
31- hash = "sha256-yMFOwh/oPiJnUsKWBGvd/GZLjkWocMAUK0r+Hx/SUPo=";
32 };
3334 nativeBuildInputs = [ makeWrapper ];
···150151 meta = with lib; {
152 homepage = "https://github.com/Logitech/slimserver";
0153 description = "Server for Logitech Squeezebox players. This server is also called Logitech Media Server";
154- # the firmware is not under a free license, but not included in the default package
155 # https://github.com/Logitech/slimserver/blob/public/8.3/License.txt
156 license = if enableUnfreeFirmware then licenses.unfree else licenses.gpl2Only;
157 mainProgram = "slimserver";
···22in
23perlPackages.buildPerlPackage rec {
24 pname = "slimserver";
25+ version = "8.4.0";
2627 src = fetchFromGitHub {
28 owner = "Logitech";
29 repo = "slimserver";
30 rev = version;
31+ hash = "sha256-92mKchgAWRIrNOeK/zXUYRqIAk6THdtz1zQe3fg2kE0=";
32 };
3334 nativeBuildInputs = [ makeWrapper ];
···150151 meta = with lib; {
152 homepage = "https://github.com/Logitech/slimserver";
153+ changelog = "https://github.com/Logitech/slimserver/blob/${version}/Changelog${lib.versions.major version}.html";
154 description = "Server for Logitech Squeezebox players. This server is also called Logitech Media Server";
155+ # the firmware is not under a free license, so we do not include firmware in the default package
156 # https://github.com/Logitech/slimserver/blob/public/8.3/License.txt
157 license = if enableUnfreeFirmware then licenses.unfree else licenses.gpl2Only;
158 mainProgram = "slimserver";
···1{ stdenv, lib, fetchFromGitHub, rustPlatform, AppKit, installShellFiles }:
23rustPlatform.buildRustPackage rec {
0004 pname = "du-dust";
5 version = "0.9.0";
6···8 owner = "bootandy";
9 repo = "dust";
10 rev = "v${version}";
11- sha256 = "sha256-5X7gRMTUrG6ecZnwExBTadOJo/HByohTMDsgxFmp1HM=";
12 # Remove unicode file names which leads to different checksums on HFS+
13 # vs. other filesystems because of unicode normalisation.
14 postFetch = ''
···1{ stdenv, lib, fetchFromGitHub, rustPlatform, AppKit, installShellFiles }:
23rustPlatform.buildRustPackage rec {
4+ # Originally, this package was under the attribute `du-dust`, since `dust` was taken.
5+ # Since then, `dust` has been freed up, allowing this package to take that attribute.
6+ # However in order for tools like `nix-env` to detect package updates, keep `du-dust` for pname.
7 pname = "du-dust";
8 version = "0.9.0";
9···11 owner = "bootandy";
12 repo = "dust";
13 rev = "v${version}";
14+ hash = "sha256-5X7gRMTUrG6ecZnwExBTadOJo/HByohTMDsgxFmp1HM=";
15 # Remove unicode file names which leads to different checksums on HFS+
16 # vs. other filesystems because of unicode normalisation.
17 postFetch = ''
···1diff --git a/pthread_stop_world.c b/pthread_stop_world.c
2-index b5d71e62..aed7b0bf 100644
3--- a/pthread_stop_world.c
4+++ b/pthread_stop_world.c
5-@@ -768,6 +768,8 @@ STATIC void GC_restart_handler(int sig)
6 /* world is stopped. Should not fail if it isn't. */
7 GC_INNER void GC_push_all_stacks(void)
8 {
···11 GC_bool found_me = FALSE;
12 size_t nthreads = 0;
13 int i;
14-@@ -851,6 +853,31 @@ GC_INNER void GC_push_all_stacks(void)
15- hi = p->altstack + p->altstack_size;
016 /* FIXME: Need to scan the normal stack too, but how ? */
17- /* FIXME: Assume stack grows down */
18+ } else {
19+ if (pthread_getattr_np(p->id, &pattr)) {
20+ ABORT("GC_push_all_stacks: pthread_getattr_np failed!");
···41+ #error "STACK_GROWS_UP not supported in boost_coroutine2 (as of june 2021), so we don't support it in Nix."
42+ #endif
43 }
44- GC_push_all_stack_sections(lo, hi, traced_stack_sect);
45- # ifdef STACK_GROWS_UP
···1diff --git a/pthread_stop_world.c b/pthread_stop_world.c
2+index 2b45489..0e6d8ef 100644
3--- a/pthread_stop_world.c
4+++ b/pthread_stop_world.c
5+@@ -776,6 +776,8 @@ STATIC void GC_restart_handler(int sig)
6 /* world is stopped. Should not fail if it isn't. */
7 GC_INNER void GC_push_all_stacks(void)
8 {
···11 GC_bool found_me = FALSE;
12 size_t nthreads = 0;
13 int i;
14+@@ -868,6 +870,31 @@ GC_INNER void GC_push_all_stacks(void)
15+ hi = p->altstack + p->altstack_size;
16+ # endif
17 /* FIXME: Need to scan the normal stack too, but how ? */
018+ } else {
19+ if (pthread_getattr_np(p->id, &pattr)) {
20+ ABORT("GC_push_all_stacks: pthread_getattr_np failed!");
···41+ #error "STACK_GROWS_UP not supported in boost_coroutine2 (as of june 2021), so we don't support it in Nix."
42+ #endif
43 }
44+ # ifdef STACKPTR_CORRECTOR_AVAILABLE
45+ if (GC_sp_corrector != 0)
···141 cadence = throw "cadence has been removed from nixpkgs, as it was archived upstream"; # Added 2023-10-28
142 cask = emacs.pkgs.cask; # Added 2022-11-12
143 cargo-embed = throw "cargo-embed is now part of the probe-rs package"; # Added 2023-07-03
0144 cargo-flash = throw "cargo-flash is now part of the probe-rs package"; # Added 2023-07-03
145 catfish = throw "'catfish' has been renamed to/replaced by 'xfce.catfish'"; # Converted to throw 2023-09-10
146 cawbird = throw "cawbird has been abandoned upstream and is broken anyways due to Twitter closing its API";
···231 drgeo = throw "'drgeo' has been removed as it is outdated and unmaintained"; # Added 2023-10-15
232 dtv-scan-tables_linuxtv = dtv-scan-tables; # Added 2023-03-03
233 dtv-scan-tables_tvheadend = dtv-scan-tables; # Added 2023-03-03
0234 dylibbundler = macdylibbundler; # Added 2021-04-24
235236 ### E ###
···141 cadence = throw "cadence has been removed from nixpkgs, as it was archived upstream"; # Added 2023-10-28
142 cask = emacs.pkgs.cask; # Added 2022-11-12
143 cargo-embed = throw "cargo-embed is now part of the probe-rs package"; # Added 2023-07-03
144+ cargo-espflash = espflash;
145 cargo-flash = throw "cargo-flash is now part of the probe-rs package"; # Added 2023-07-03
146 catfish = throw "'catfish' has been renamed to/replaced by 'xfce.catfish'"; # Converted to throw 2023-09-10
147 cawbird = throw "cawbird has been abandoned upstream and is broken anyways due to Twitter closing its API";
···232 drgeo = throw "'drgeo' has been removed as it is outdated and unmaintained"; # Added 2023-10-15
233 dtv-scan-tables_linuxtv = dtv-scan-tables; # Added 2023-03-03
234 dtv-scan-tables_tvheadend = dtv-scan-tables; # Added 2023-03-03
235+ du-dust = dust; # Added 2024-01-19
236 dylibbundler = macdylibbundler; # Added 2021-04-24
237238 ### E ###
···164 flask_sqlalchemy = flask-sqlalchemy; # added 2022-07-20
165 flask_testing = flask-testing; # added 2022-04-25
166 flask_wtf = flask-wtf; # added 2022-05-24
167+ flask-autoindex = throw "flask-autoindex was removed, as it is not compatible with flask 3.0 and unmaintained since 2020.";
168+ flask-basicauth = throw "flask-basicauth was removed, as it is not compatible with flask 3.0 and unmaintained since 2016.";
169+ flask-sessionstore = throw "flask-sessionstore was removed, as it is not compatible with flask 3.0 and unmaintained since 2017.";
170 flowlogs_reader = flowlogs-reader; # added 2024-01-03
171 FormEncode = formencode; # added 2023-02-19
172 foundationdb51 = throw "foundationdb51 is no longer maintained, use foundationdb71 instead"; # added 2023-06-06
···53 pkgsStatic = true;
54 pkgsCross = true;
55 pkgsi686Linux = true;
056 };
5758 # No release package attrname may have any of these at a component
···53 pkgsStatic = true;
54 pkgsCross = true;
55 pkgsi686Linux = true;
56+ pkgsExtraHardening = true;
57 };
5859 # No release package attrname may have any of these at a component
+13
pkgs/top-level/stage.nix
···276 gcc.abi = "elfv2";
277 };
278 });
0000000000000279 };
280281 # The complete chain of package set builders, applied from top to bottom.