5207 Commits

Author SHA1 Message Date
Robert Hensing aa1345fd8a lib/services: fix reload/readiness bugs and add compliance coverage (#540857) 2026-07-23 16:49:52 +00:00
cinereal ae9994806c lib/services: fix reload/readiness bugs and add compliance coverage
Fixes several correctness bugs primarily around modular services' recent
reload/notification options (#535695) and adds compliance coverage to guard them.

Fixes:

- `lib/services/service.nix`:
  - the reload-conflict assertion had inverted polarity, so it fired on the
    default configuration
  - the `mkIf` guard on `process.reloadCommand` had a misplaced paren, applying
    `!= null` to the `mkIf` result rather than to the condition
  - `process.reloadSignal` derives `process.reloadCommand`, so the assertion
    could not check `reloadCommand != null` -- that fired on every signal-only
    service. The command is now derived at `mkDefault` priority and the
    assertion is gated on `options.process.reloadCommand.highestPrio`, firing
    only when the user also set `reloadCommand` explicitly.
  - change `notificationProtocol` to a sub-module type
- `nixos/modules/system/service/systemd/service.nix`:
  - `systemd.mainExecReload`'s default ran `escapeSystemdExecArgs` (a list
    escaper) on the `nullOr str` `process.reloadCommand`; this threw
    `expected a list but found a string` and would have mangled `$MAINPID`. It
    now uses `process.reloadCommand` verbatim.
  - the `Type` default read a non-existent
    `config.serviceManager.notificationProtocol` instead of
    `config.notificationProtocol`.

Tests:

Extend the modular-service compliance suite to guard the above:

- Portable (manager-agnostic) eval assertions: `reloadSignal` derives
  `reloadCommand`, the conflict assertion does not fire on signal-only services
  but does when both are set explicitly, and `notificationProtocol.systemd`/`.s6`
  default to `false`.
- systemd-specific eval assertions: `serviceConfig.Type` (simple/notify) and
  `serviceConfig.ExecReload` are asserted on the resolved host units. This
  directly guards the `mainExecReload` fix, which threw before it.
- Runtime reload compliance test: a nested reloadable sub-service is started and
  reloaded, asserting the service observed the reload (recorded a SIGHUP marker).
  `callReload` receives the service's name path (the list of names from the
  top-level service down to the target sub-service); each integration joins it
  per its own unit-naming convention (NixOS dash-joins to the systemd unit name,
  e.g. `reload-inner.service`). Keeping it a path list rather than a read-only
  submodule option keeps the suite manager-agnostic.
- `doc/build-helpers/testers.chapter.md`: document `callReload`.

Follow-up to #535695.

Signed-off-by: cinereal <cinereal@riseup.net>
Assisted-by: Claude:claude-opus-4-8
2026-07-20 11:01:04 +02:00
Jo d97f35d9a4 celestia: 1.6.4 -> 1.6.4-unstable-2026-07-02 (#540555) 2026-07-16 10:29:26 +00:00
Johannes Kirschbauer 3436493e89 doc: fix malformed fenced divs (#541946) 2026-07-16 10:14:26 +00:00
Alyssa Ross cfa7d6949d wordnet: make use of lib.licenses.wordnet (#540729) 2026-07-15 11:36:44 +00:00
Alyssa Ross 774a1363f6 buddy: change license to lib.licenses.buddy (#540731) 2026-07-15 11:36:02 +00:00
pancaek 0d7517afd3 lib/licenses: add CC-BY-NC-3.0-IGO and JPL-image licenses 2026-07-14 21:43:12 -07:00
Ryan Mulligan 35260ee51a doc: fix additional malformed fenced divs 2026-07-14 14:03:26 -07:00
Ryan Mulligan d875aae529 doc: fix mmdoc fenced div rendering 2026-07-14 14:02:36 -07:00
Malix - Alix Brunet fa23725d3b options: mkOption docs update 2026-07-14 13:36:34 +02:00
Jo c4a4f9aaff ngrep: make use of lib.licenses (#540728) 2026-07-14 08:40:57 +00:00
Bjørn Forsman a15b1f5f01 t1utils: use lib.licenses.mit-click (#540726) 2026-07-11 17:26:01 +00:00
Aaron Andersen fa6488337a lib/services: add some generalization options (#535695) 2026-07-11 12:26:04 +00:00
jopejoe1 69b4b1d0c0 lib.licenses: add wordnet 2026-07-11 13:48:47 +02:00
jopejoe1 7757c50b02 lib.licenses: add ngrep 2026-07-11 13:44:33 +02:00
jopejoe1 40a92d9a24 lib.licenses: add mit-click 2026-07-11 13:43:10 +02:00
jopejoe1 9c089e7a30 lib.licenses: add buddy 2026-07-11 13:41:51 +02:00
zowoq 5623c90edc lib/tests/misc: use x86_64-freebsd instead of x86_64-darwin (#535512) 2026-07-11 02:37:35 +00:00
eveeifyeve aae4936e07 lib/services: add reload support for service management 2026-07-11 04:21:03 +10:00
eveeifyeve 03deb31b6b lib/services: add service readiness protocol support 2026-07-11 04:21:03 +10:00
nixpkgs-ci[bot] 5b0a62639f Merge master into staging-next 2026-07-08 06:51:14 +00:00
Ben Siraphob 45ecf43c51 lib.meta-types: add binary either/both combinators
Every in-tree union/intersection use has exactly two members, and the
binary form verifies without allocating a closure or calling the any/all
primop per check. check-meta.nix switches to either/both; union and
intersection are kept for potential future use.

Assisted-by: Claude Code (Claude Fable 5)
2026-07-07 09:40:17 -07:00
Eman Resu 25a7ae8e4c lib.platforms: move primary systems to the beginning of the list 2026-07-04 09:36:48 -04:00
nixpkgs-ci[bot] 0e1056cb37 Merge master into staging-next 2026-07-02 14:28:02 +00:00
Matt Sturgeon c00644f728 Module system types.attrTag implement declaration info in options (#531031) 2026-07-02 12:38:20 +00:00
nixpkgs-ci[bot] c5a80d8625 Merge master into staging-next 2026-07-01 18:40:23 +00:00
yaya 53cd6f263c lib/trivial: Bump oldestSupportedRelease to 2605
NixOS 25.11 is end-of-life.
2026-07-01 14:01:54 +02:00
nixpkgs-ci[bot] b53cb02803 Merge master into staging-next 2026-07-01 07:31:55 +00:00
Eman Resu ed29e1b031 lib.strings: remove throwIfNot usage
throwIfNot sends our error message through a function call, even if the
error condition doesn't trigger. This requires a lot of thunk allocation
that can be easily avoided.
2026-06-30 21:38:27 -04:00
Eman Resu bb50241c60 lib.modules: remove throwIfNot usage
throwIfNot sends our error message through a function call, even if the
error condition doesn't trigger. This requires a lot of thunk allocation
that can be easily avoided.
2026-06-30 21:38:26 -04:00
Eman Resu e1ae8a8194 lib.gvariant.mkArray: refactor 2026-06-30 21:38:26 -04:00
Eman Resu feb74fca37 lib.gvariant: remove throwIfNot usage
throwIfNot sends our error message through a function call, even if the
error condition doesn't trigger. This requires a lot of thunk allocation
that can be easily avoided.
2026-06-30 21:38:26 -04:00
Eman Resu 079b1a7d07 lib.derivations: remove throwIfNot usage
throwIfNot sends our error message through a function call, even if the
error condition doesn't trigger. This requires a lot of thunk allocation
that can be easily avoided.
2026-06-30 21:38:26 -04:00
Eman Resu 44eafb2953 lib.types: remove throwIf usage
throwIf sends our error message through a function call, even if the
error condition doesn't trigger. This requires a lot of thunk allocation
that can be easily avoided.
2026-06-30 21:38:25 -04:00
Eman Resu dd6f1736b7 lib.gvariant: remove throwIf usage
throwIf sends our error message through a function call, even if the
error condition doesn't trigger. This requires a lot of thunk allocation
that can be easily avoided.
2026-06-30 21:38:25 -04:00
Eman Resu c81b12b698 lib.fetchers: remove throwIf usage
throwIf sends our error message through a function call, even if the
error condition doesn't trigger. This requires a lot of thunk allocation
that can be easily avoided.
2026-06-30 21:38:25 -04:00
Eman Resu ce99cfa103 lib.types: remove assertMsg usage
assertMsg sends our error message through a function call, even if the
error condition doesn't trigger. This requires a lot of thunk allocation
that can be easily avoided.
2026-06-30 21:38:25 -04:00
Eman Resu 855f2d0435 lib.strings: remove assertMsg usage
assertMsg sends our error message through a function call, even if the
error condition doesn't trigger. This requires a lot of thunk allocation
that can be easily avoided.
2026-06-30 21:38:24 -04:00
Eman Resu 4ff2645579 lib.path: remove assertMsg usage
assertMsg sends our error message through a function call, even if the
error condition doesn't trigger. This requires a lot of thunk allocation
that can be easily avoided.
2026-06-30 21:38:24 -04:00
Eman Resu a017ab10eb lib.network: remove assertMsg usage
assertMsg sends our error message through a function call, even if the
error condition doesn't trigger. This requires a lot of thunk allocation
that can be easily avoided.
2026-06-30 21:38:24 -04:00
Eman Resu 1e47a49c79 lib.meta: remove assertMsg usage
assertMsg sends our error message through a function call, even if the
error condition doesn't trigger. This requires a lot of thunk allocation
that can be easily avoided.
2026-06-30 21:38:23 -04:00
Eman Resu 2221cbb4aa lib.lists: remove assertMsg usage
assertMsg sends our error message through a function call, even if the
error condition doesn't trigger. This requires a lot of thunk allocation
that can be easily avoided.
2026-06-30 21:38:22 -04:00
Eman Resu 370135bdc8 lib.generators: remove assertMsg usage
assertMsg sends our error message through a function call, even if the
error condition doesn't trigger. This requires a lot of thunk allocation
that can be easily avoided.
2026-06-30 21:37:46 -04:00
nixpkgs-ci[bot] d8a7dfa41f Merge master into staging-next 2026-06-30 00:44:58 +00:00
Jörg Thalheim f53d98faed nixVersions: drop nix_2_28 and nix_2_30 (#536372) 2026-06-29 19:46:45 +00:00
nixpkgs-ci[bot] 0d28c0688f Merge master into staging-next 2026-06-29 15:34:33 +00:00
Eman Resu 14234b49ba lib.sources.fromSourceAttributes: don't filter if no conditions passed 2026-06-29 09:30:56 -04:00
Eman Resu 22842dedee lib.sources.toSourceAttributes: default filter to null 2026-06-29 09:30:47 -04:00
Eman Resu f2b8637f79 lib.sources.cleanSourceFilter: partially apply checks 2026-06-29 09:30:46 -04:00
Jörg Thalheim 7d940ca082 nixVersions.nix_2_28: remove
Nix 2.28 was the last release packaged with the monolithic
common-meson.nix expression and is no longer maintained upstream.
Drop it together with the now-unused common-meson.nix and nix-perl.nix
helpers and the storeDir/stateDir/confDir plumbing that only fed
that code path.
2026-06-28 20:50:31 +03:00