Commit Graph

3816 Commits

Author SHA1 Message Date
Darragh Elliott
ab385083dc nixos/resolved: move to systemd tooling, rename options 2026-01-11 00:18:01 +01:00
Wolfgang Walther
0886339dd1 maintainers: drop grahamc
Inactive since April 2025. Removing according to maintainer guidelines.
2026-01-10 21:31:14 +01:00
r-vdp
3408d1a4a9 nixos/switchable-system: improve switch inhibitors
Improvements:
1. Turn the nix value into an attrset so that every inhibitor has a name
   that we can match between generations
2. Write the attrset to a file as JSON
3. When checking, we load the JSON files from both the current and the
   new generation into a jq pipeline and match up the keys.
   We output a dict with a value for every key that is present in both
   generations with a different value.
4. Build in error handling for different corner cases (missing files,
   non-JSON content)
2026-01-09 11:59:26 +02:00
nikstur
7f49ae6543 nixos/nixos-init: conflict with postBootCommands and powerUpCommands (#474454) 2026-01-08 22:36:36 +00:00
Majiir Paktu
e656d186b2 nixos/nixos-init: conflict with postBootCommands and powerUpCommands 2026-01-06 21:00:36 -05:00
nixpkgs-ci[bot]
a9db0efa12 Merge master into staging-nixos 2026-01-07 00:18:45 +00:00
r-vdp
a998d196ab nixos/switchable-system: only include the switch-inhibitors check when we have inhibitors 2026-01-06 23:50:10 +02:00
r-vdp
2c3ee7a8f3 nixos/switchable-system: improve error message in case switch inhibitors changed 2026-01-05 12:19:07 +02:00
nixpkgs-ci[bot]
03049de07d Merge master into staging-nixos 2026-01-05 00:21:29 +00:00
Sandro
8219a18608 nixos/networkd: fix eval after #469143 2026-01-04 23:15:30 +01:00
Sandro
f26a23fdc8 nixos/networkd: allow "runtime" as a valid value for dhcpServerConfig.PersistLeases (#469143) 2026-01-04 21:14:41 +00:00
nixpkgs-ci[bot]
08660452fd Merge master into staging-nixos 2026-01-04 18:07:10 +00:00
Thiago Kenji Okada
a55bb24b49 nixos-rebuild-ng: pass the NIXOS_NO_CHECK variable through the systemd-run and sudo invocations (#475295) 2026-01-04 12:46:35 +00:00
r-vdp
aff9387dd4 nixos/switchable-system: don't add switch inhibitors by default 2026-01-04 13:06:50 +02:00
Colin
eae4139c54 nixos/activation: use the builder's sed
9bfd0d688d changed this line from
`substituteInPlace` to `sed`, but in the case of cross compilation
that would use the host's `sed`, which isn't necessarily executable by
the build machine.
2026-01-02 22:53:30 +00:00
r-vdp
15dc91ff95 nixos-rebuild-ng: pass the NIXOS_NO_CHECK variable through the systemd-run and sudo invocations
This allows to skip nixos pre-switch check when running switch-to-configuration.
2025-12-30 16:40:24 +02:00
Ramses
bbc8ebac5a nixos/activation: avoid build failure with large activation script (#474379) 2025-12-28 23:53:41 +00:00
r-vdp
9bfd0d688d nixos/activation: avoid build failure with large activation script
Two improvements:
* use `writeShellApplication` (which uses `passAsFile` instead of
  passing the activation script as an env var into the derivation.
  We disable shellcheck and the bash options that this builder
  usually adds to avoid issues with out-of-tree activation scripts.
* use `sed` instead of `substituteInPlace`, since the substitute
  functions load the file content into a shell variable

This avoids issues when the activation is too long to fit in a shell variable.
Before this commit, a very large activation script, would cause build
failures because of different limits on the file content size, e.g.
```
➜ nix build -f . nixosTests.restartByActivationScript.nodes.machine.system.build.toplevel -vL
this derivation will be built:
  /nix/store/xw6anpfjyamnycjg58cmj01sz3ididyl-nixos-system-machine-test.drv
building '/nix/store/xw6anpfjyamnycjg58cmj01sz3ididyl-nixos-system-machine-test.drv'...
nixos-system-machine-test> error: executing '/nix/store/rlq03x4cwf8zn73hxaxnx0zn5q9kifls-bash-5.3p3/bin/bash': Argument list too long
error: builder for '/nix/store/xw6anpfjyamnycjg58cmj01sz3ididyl-nixos-system-machine-test.drv' failed with exit code 1;
       last 1 log lines:
       > error: executing '/nix/store/rlq03x4cwf8zn73hxaxnx0zn5q9kifls-bash-5.3p3/bin/bash': Argument list too long
       For full logs, run:
        nix log /nix/store/xw6anpfjyamnycjg58cmj01sz3ididyl-nixos-system-machine-test.drv
```
2025-12-28 01:41:12 +02:00
r-vdp
93cda47a1f nixos/switchable-system: introduce a standard pre-switch check to prevent switching under certain conditions
This commit introduces "switch inhibitors" which are derivations that
prevent a switch of a system to a new configuration if those derivations
don't have the same hash in both configurations.
This means that we can for instance add the systemd and dbus derivations
such that users will be instructed to reboot their system when those
derivations have changed instead of switching.

This feature should be used sparingly, but it can make NixOS more robust
by avoiding users switching to a configuration that can make their
system unstable (like major updates of systemd, or new versions of dbus
since the dbus and dbus-broker daemons cannot be restarted).

The user can still force the switch by setting an env var.
2025-12-25 12:02:34 +02:00
nixpkgs-ci[bot]
569ecbfe36 Merge master into staging-nixos 2025-12-23 18:07:38 +00:00
Robert Hensing
d222d01cd2 nixos/modular-services: add systemd.mainExecStart option (#469450) 2025-12-23 12:08:27 +00:00
Simon Gardling
3eb679206a nixos/boot: add options to configure stage 1 and stage 2 boot greetings 2025-12-21 15:45:48 +02:00
Jared Baur
a2fb97f80e nixos/systemd-boot-builder: add leading slash to devicetree path (#453989) 2025-12-11 16:55:16 +00:00
Robert Hensing
7b4d26bf86 nixos/modular-services: add systemd.mainExecStart option
Provide indirection for ExecStart to enable control over systemd
specifier and variable substitution, while escaping process.argv
by default for literal arguments.
2025-12-11 10:38:03 +01:00
Jörg Thalheim
693ab78155 nixos/nix-daemon-firewall: Add a module to firewall FODs (#464613) 2025-12-10 22:52:15 +00:00
Alexandru Tocar
806f8a090c nixos/networkd: allow "runtime" as a valid value for dhcpServerConfig.PersistLeases 2025-12-09 02:49:08 +01:00
Jared Baur
33849bdfbe Crypto kernel modules cleanup (#468804) 2025-12-08 15:09:22 +00:00
Matt Sturgeon
6497e300b8 nixos/binfmt: move magics to separate file (#434136) 2025-12-08 09:12:40 +00:00
Elliot Berman
556701245c nixos/luksroot: Move input_leds to boot.initrd.luks.cryptoModules
input_leds is commonly wanted, but not strictly needed, for luks. It
provides caps lock key LED functionlaity for most keyboards, which is
useful when inputing a password to unlock a LUKS filesystem.
2025-12-07 14:03:18 -08:00
Elliot Berman
e7dca1c3c6 nixos/luksroot: Remove explicit cryptd from boot.initrd.availableKernelModules
crytpd is a helper module which *may* be compiled based on architecture
and/or crypto algorithms which are supported (built) in the kernel.
Since not all kernels need cryptd to do LUKS-based encryption, move
cryptd to cryptoModules which can be configured based on the built
kernel.
2025-12-07 14:02:55 -08:00
matthewcroughan
34cd6f4869 nixos/systemd: make systemd-nspawn@.service optional 2025-12-07 00:19:44 +00:00
F.P.
de2c0dc04c nixos/unl0kr: add libinput quirks to initrd
Fixes libinput quirks not found in initrd as seen in log:

  unl0kr-agent: libinput error: Failed to load the device quirks
2025-12-03 14:01:08 +01:00
nixpkgs-ci[bot]
7b20dce04d Merge master into staging-nixos 2025-12-01 00:22:45 +00:00
nikstur
c87c75967b nixos/etc-overlay: fix shellcheck issues and remove outdated comment (#464786) 2025-11-30 21:04:38 +00:00
Janne Heß
dd9cc36cd0 nixos/resolved: Fix nix-daemon-firewall with resolved 2025-11-29 21:31:00 +01:00
Florian Klink
66eb6e7cc4 nixos/activation: avoid generating empty activation scripts (#464784) 2025-11-29 11:41:28 +00:00
Aleksana
1c75a91d56 nixos/zram-as-tmp: fix boot failure caused by e2fsprogs not available (#465161) 2025-11-28 12:59:28 +00:00
Luna Nova
e95bd0bf1c nixos/systemd-boot: use new combined memtest86plus binary
memtest86plus puts the path to the binary at a passthru attr

after memtest86plus 8 there's a single combined EFI+legacy file
2025-11-27 13:19:24 +03:00
Luna Nova
48a6b898ae nixos/grub: use new combined memtest86plus binary
memtest86plus puts the path to the binary at a passthru attr

after memtest86plus 8 there's a single combined EFI+legacy file
2025-11-27 13:19:24 +03:00
MidAutumnMoon
fb093b46b5 nixos/zram-as-tmp: fix boot failure caused by e2fsprogs not available
This module made the assumption that `e2fsprogs` will always be
available in `system.fsPackages`, whereas on my system with tmpfs as
root+btrfs setup, e2fsprogs is not added to `fsPackages`, causing zram-generator
failed to find mkfs.ext4.

Related log:

```
systemd-makefs[555]: mkfs binary for ext4 is not available.
```
2025-11-26 15:55:06 +08:00
r-vdp
1a0f9e6b04 nixos/etc-overlay: remove outdated comment (findmnt works as advertised) 2025-11-24 23:55:59 -03:00
r-vdp
fc3e644e4f nixos/etc-overlay: fix shellcheck issues in activation script 2025-11-24 23:55:34 -03:00
r-vdp
e16bd36ed6 nixos/activation: avoid generating empty activation scripts 2025-11-24 16:08:04 -03:00
r-vdp
01aacd04f8 nixos/etc-overlay: pad the mode when building the composefs dump
Fixes https://github.com/NixOS/nixpkgs/issues/462972
2025-11-22 20:49:09 -03:00
Robert Hensing
41b98b4a8a nixos: Shuffle definitions and deprecate system.extraSystemBuilderCmds
Shuffle:
The definitions are now combined into a single option. Since they have
no interdependencies, that's ok, but you may notice this trivial change
by a changed hash, and analyzing with nix-diff.

Deprecation:
Use the option `system.systemBuilderCommands` instead.
2025-11-12 21:00:32 +01:00
Paul Haerle
44c30b3ff9 nixos/systemd-networkd: Add missing option in netdev Tunnel (#452205) 2025-11-10 13:20:41 +00:00
jamie
754edf0e23 limine: fix typo ('streched' to 'stretched') 2025-11-07 22:12:27 +00:00
Acid Bong
d24ec930d5 nixos/boot.tmp: fix description rendering 2025-11-06 17:37:32 +02:00
Benedikt Hiemer
143040786b nixos/journald-gateway: change default of user and system option to false
Until now, both options are set to true as default. But the systemd-journal-gatewayd
service defaults them to false. To match the origin behaviour, the defaults have been
changed.
2025-11-03 08:21:00 +01:00
Benedikt Hiemer
532ba62c26 nixos/journald-gateway: remove assertion making system and user args truly optional 2025-11-01 11:41:41 +01:00