Commit Graph

437 Commits

Author SHA1 Message Date
Ryan Hendrickson
7532d3bfc2 Reapply "nixos/seerr: use lib.mkStateRevisionOption"
This reverts commit 8820b84c40.
2026-08-12 15:38:03 -04:00
Peder Bergebakken Sundt
e1b62608ae formats: use AST-based approach for codegen (#549114) 2026-08-12 19:02:33 +00:00
nixpkgs-ci[bot]
88f341688a Merge master into staging-nixos 2026-08-08 18:09:13 +00:00
K900
8820b84c40 Revert "nixos/seerr: use lib.mkStateRevisionOption" 2026-08-08 18:36:46 +03:00
nixpkgs-ci[bot]
9e99dc6829 Merge master into staging-nixos 2026-08-08 00:17:04 +00:00
Ryan Hendrickson
e060fe4584 nixos/seerr: use lib.mkStateRevisionOption (#509450) 2026-08-07 18:32:51 +00:00
jtrrll
f31483b7b2 nixos/test-driver: use timedelta for timeouts and durations 2026-08-05 10:07:38 -04:00
h7x4
bcfcbbee95 nixos/doc: add note about comment stripping for formats.pythonVars 2026-08-04 21:34:57 +09:00
Maximilian Bosch
b9706678ac nixos/test-driver: deprecate shell_interact()
Reviewing #512771 got me thinking and I'm not sure I see a good reason
to keep this method given the SSH backdoor functionality has a much
better UX.

I'd propose we deprecate it, await 26.11 to see if people complain and
remove it alltogether after that.
2026-06-26 12:27:41 +02:00
Matthias Beyer
32b0eb216a nixos/doc: Fix typo
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2026-06-23 15:19:30 +02:00
Sandro
e00726a075 treewide: fix leftover docbook links (#531477) 2026-06-21 18:03:51 +00:00
Ryan Hendrickson
a102251d66 utils.mkStateRevisionOption: init 2026-06-16 21:02:44 -04:00
Pol Dellaiera
29c66c6eaa pkgs.formats.configobj: init
Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
2026-06-16 20:58:27 +02:00
Sandro Jäckel
6c0cb2defd treewide: fix leftover docbook links 2026-06-13 23:37:09 +02:00
Malix - Alix Brunet
5eebcdb3e1 treewide: update nix-darwin link 2026-05-27 20:26:42 +02:00
Robert Hensing
f1b62fdc4e types.attrListWith: add asAttrs
This allows the type's return value to be accessed more easily.

Motivating use case:
- Built-in module provides CLI functionality by declaring
  an `attrListWith { asAttrs = true; }`, extracting the ordered list
  from `valueMeta` for the purpose of creating the `argv`.
- User modules can read the command line's flags directly without
  having to parse the list of attrs.
2026-05-24 15:07:05 +02:00
Robert Hensing
17fdb6f68a types.attrListWith: init
Trivial extraction from attrListOf.
2026-05-24 15:07:05 +02:00
Robert Hensing
43d998e6c0 types.attrListOf: init
This adds a type for name-value mappings that preserve ordering.

Motivating use case: command line flags for package modules /
wrappers / modular services.
The option value can be transformed into a command line in the
correct order.
Additionally, a convenience readOnly option could be provided
to give easy introspection access to the values in an ad hoc
manner.
2026-05-24 15:07:02 +02:00
Maximilian Bosch
1987c483d8 nixos/test-driver: use vhost-device-vsock for SSH backdoor
`vhost-device-vsock`[1] is a custom implementation of AF_VSOCK, but the
application on the host-side uses a UNIX domain-socket. This gives us
the following nice properties:

* We don't need to do `--arg sandbox-paths /dev/vhost-vsock` anymore for
  debugging builds within the sandbox. That means, untrusted users can
  also debug these kinds of tests now.

* This prevents CID conflicts on the host-side, i.e. there's no need for
  using `sshBackdoor.vsockOffset` for tests anymore.

A big shout-out goes to Allison Karlitskaya, the developer of test.thing[2]
who talked about this approach to do AF_VSOCK on All Systems Go 2025.

This patch requires systemd 258[3] because this contains `vhost-mux` in
its SSH config which is needed to connect to the VMs from now on.

To not blow up the patches even more, this only uses AF_VSOCK for the
debugger. A potential follow-up for the future would be a removal of the
current `backdoor.service` and replace it entirely by this
functionality.

The internal implementation tries to be consistent with how VLANs and
machines are handled, i.e. the processes are started when the Driver's
context is entered and cleaned up in __exit__().

I decided to push the process management and creation of sockets for
vhost-device-vsock into its own class, that's an implementation detail
and not a concern for the test-driver. In fact, `vhost-device-vsock` is
something we can drop once QEMU implements native support for using
AF_UNIX on the host-side[4]. `VsockPair` is its own class since
returning e.g. a triple of `(Path, Path, Int)` would be ambiguous in
what is the guest and what the host path (and frankly, I found it hard
to distinguish the two when reading the docs of `vhost-device-vsock`
initially).

Finally, now that we can do the SSH backdoor without adding additional
devices to the sandbox, I figured, it's time to write a test-case for
it.

[1] https://github.com/rust-vmm/vhost-device/blob/main/vhost-device-vsock/README.md
[2] https://codeberg.org/lis/test.thing
[3] https://github.com/NixOS/nixpkgs/pull/427968
[4] https://gitlab.com/qemu-project/qemu/-/issues/2095
2026-04-15 15:45:33 +01:00
Robert Hensing
8d4e372952 lib.types: add types.option (#499945) 2026-04-08 13:41:10 +00:00
cinereal
7334dd9096 lib.types: add types.option
Signed-off-by: cinereal <cinereal@riseup.net>
2026-04-02 12:10:29 +02:00
Kierán Meinhardt
4e91a4a0f3 nixos/doc: document systemd-nspawn test containers 2026-03-19 12:14:51 +01:00
Arian van Putten
7553fce9f7 nixos/doc: add hcl1 format 2026-02-27 11:37:45 +01:00
Johannes Kirschbauer
c988f82f7a lib/types: add types.{json,toml} from pkgs.formats 2026-01-20 21:26:05 +01:00
r-vdp
2e27234c87 nixos/activation: deprecate reloading or restarting units from the activation script
This deprecation is part of a bigger effort to deprecate activation scripts altogether, which will take place over several releases.
There are no in-tree usages of the now-deprecated reload/restart functionality.
2025-12-22 19:01:18 +02:00
Tom Herbers
c9dc62eda1 treewide: switch to channels.nixos.org
This is a follow-up for #460057 to completely remove all mentions of nixos.org/channels/.

The following command was used to generate this change:

```
find . -type f -exec sed -i 's|nixos.org/channels/|channels.nixos.org/|g' {} +
```
2025-11-17 23:41:39 +01:00
Felix Buehler
3106949fd7 lib/types: add externalPath 2025-11-04 22:57:16 +01:00
Robert Hensing
553d8e9ee9 doc/option-types: Improve union type docs 2025-10-28 18:47:45 +01:00
Felix Bühler
6ef6063ef6 pkgs.formats.plist: init (#448839) 2025-10-16 19:28:50 +00:00
Sizhe Zhao
93ab9d0a42 nixos/doc: add pkgs.formats.plist 2025-10-08 11:53:39 +08:00
nixpkgs-ci[bot]
2f8516c5ac Merge master into staging-next 2025-10-02 06:05:42 +00:00
h7x4
b7cdcad895 nixos/doc: add documentation for formats.pythonVars 2025-09-18 18:15:57 +02:00
Wolfgang Walther
b9ec8bed14 treewide: fix typos in md files (#439306) 2025-09-09 08:03:31 +00:00
Ben Siraphob
7b646b7f6d nixos: fix typos 2025-09-09 13:14:35 +07:00
Emily
3b7e7e362b haskell.compiler.ghc928: drop 2025-09-07 18:45:52 +01:00
Jared Baur
88a11a0dcd switch-to-configuration-ng: add more logging
Adds more logging to the non-systemd related parts of
switch-to-configuration.
2025-09-02 21:41:00 +01:00
Robert Hensing
d88b9464b0 system.services: Remove ambiguous, redundant pkgs module argument
Primary reasons: remove implicit dependencies and force uniformity.
See nixos/modules/system/service/README.md for detailed rationale.
2025-08-20 11:44:06 +02:00
Robert Hensing
0b9a1cb426 nixos/README-modular-services: init 2025-08-09 00:32:59 +02:00
Wolfgang Walther
fed181fac1 nixos/doc/modular-services: run nixfmt on code blocks 2025-08-05 17:08:45 +02:00
Robert Hensing
f5ee08446a Modular services (#372170) 2025-07-24 16:46:34 +02:00
Wolfgang Walther
62fe016519 treewide: run treefmt with mdcr/nixfmt 2025-07-24 13:52:31 +02:00
Wolfgang Walther
6c47e7d5da treewide: fix syntax errors in nix code blocks
Fixes all code blocks with "nix" language in markdown files for syntax
errors to be able to run nixfmt in the next step.
2025-07-24 13:52:29 +02:00
Maximilian Bosch
9372904a35 nixos/doc: clarify scope of debugHook feature in the test driver
As discussed with tfc before, it's probably better in most cases to try
the interactive test-driver with the SSH backdoor first and resort to
this feature for flaky tests.
2025-07-20 15:46:14 +02:00
Robert Hensing
1f4e476269 nixos/doc: Modular services introduction is formally 25.11
I think we should backport it nonetheless.
2025-07-20 03:19:28 +02:00
Robert Hensing
af04a80c76 modular-services: merge process.argv from executable and args 2025-07-20 03:01:06 +02:00
Robert Hensing
03c4d4bc66 nixos/doc/modular-services: Use package attr in example
Without a proper introduction it's really really hard to make sense of the examples, and where values come from; which are arbitrary, which are conventional, which are hard-coded into some part of the framework.

Co-authored-by: Valentin Gagarin <valentin@gagarin.work>
2025-07-20 03:01:06 +02:00
Robert Hensing
7d7b678ed6 nixos/doc/modular-services: Explain configuration mgmt framework
Co-authored-by: Valentin Gagarin <valentin@gagarin.work>
2025-07-20 03:01:06 +02:00
Robert Hensing
b7ded19010 nixos/doc: Add modular services section 2025-07-20 03:01:06 +02:00
Jacek Galowicz
d6b326d659 test-driver: Implement debugging breakpoint hooks
Co-authored-by: Maximilian Bosch <maximilian@mbosch.me>
2025-07-18 17:39:01 +02:00
Philip Taron
8279ffe622 treewide: specify that mebibytes are used when it's ambiguous (#424169) 2025-07-11 12:29:33 -07:00