Commit Graph

3816 Commits

Author SHA1 Message Date
x7c2d
12f553550f nixos/systemd-networkd: add new options for v260
systemd 260 introduces some new linkConfig options to configure ethernet
devices and a new [MobileNetwork] section (and options) to configure
cellular network connections using a new integration with ModemManager.

- https://github.com/systemd/systemd/releases/tag/v260
2026-04-26 00:06:57 +01:00
Will Fancher
835b3f77b2 nixos/luksroot: Improve systemd stage 1 assertion messages 2026-04-25 18:38:49 -04:00
r-vdp
1c7c4d2291 nixos/etc: clear stale opaque markers from mutable overlay upperdir
Fix by walking the newly-mounted metadata layer before the overlay is
(re)mounted and removing trusted.overlay.opaque from any upperdir
directory that now has a counterpart in the lowerdir. This turns those
directories back into merged views: user-placed files and individual
whiteouts are preserved, only the blanket hiding of lowerdir content
is undone.

Applied in both the activation script (switch-to-configuration) and
the initrd rw-etc service (boot), since the upperdir persists across
reboots. Uses the new clear-etc-opaque entrypoint of nixos-init so the
initrd stays bash-free.

Fixes #505475
2026-04-23 11:51:39 +02:00
Will Fancher
983d84d401 nixos/systemd/initrd: Check MODULES accurately
`config.system.build.kernel.config` is not actually accurate. When a
kconfig is specified in the `config` argument to `kernel/build.nix`
(a.k.a. `manualConfig` or `linuxManualConfig`), then `isSet` will
return `true` and other queries like `isYes` will be accurate. But if
a kconfig is not specified in that `config` argument, then `isSet`
will return `false` and other queries will be inaccurate, e.g. `isYes`
"MODULES"` can return `false` even though your `configfile` has it
enabled.

Note the difference between the `config` argument and the `configfile`
argument. The `configfile` is how the kernel will be actually built,
while `config` is merely passed through as a source of eval-time
information. Importantly, neither is derived from the other *in any
way*, unless `builtins.isPath configfile || allowImportFromDerivation`
in which case the default value for `config` is derived from reading
`configfile`.

The more generic `kernel/generic.nix` (a.k.a. `buildLinux`) creates
its `configfile` in a derivation, so it cannot be read at eval time by
default. It calls into `kernel/build.nix`, and only passes a `config`
with `CONFIG_MODULES`, `CONFIG_FW_LOADER`, and `CONFIG_RUST` set. So
almost nothing in `kernel.config` is accurate in the typical
case. `MODULES` happens to be one of the three that *is* accurate
typically, but regardless we obviously can't rely on that since a user
of `kernel/build.nix` is likely to mess it up. Even worse,
`structuredExtraConfig` is not incorporated into `kernel.config` at
all, which leads to the incredibly confusing scenario where a kconfig
is specified in `structuredExtraConfig` but still is not represented
accurately by these queries.

All of this is why, in most cases, the implementation of
`requiredKernelConfig` deliberately does absolutely nothing and
creates an empty list of assertions, and it's all extremely confusing.

With all that in mind:

TODO:

- The structured config used to generate the `configfile` should be
  reflected in the `config` argument to `kernel/build.nix`, and
  consequently `kernel.config`.
- The three kconfigs represented by `config` in `kernel/generic.nix`
  now, `CONFIG_MODULES`, `CONFIG_FW_LOADER`, and `CONFIG_RUST`, should
  be set in the structured config.
- Queries for kconfigs that we don't actually know the value of at
  eval time should fail to evaluate, rather than evaluating
  inaccurately.
- Most of the ways we use these eval-time queries should instead be
  done at build time, so they can use the complete `configfile` rather
  than the incomplete eval-time `config` value.
- The ones that we still want to happen at eval-time should be more
  prepared for the possibility that we can't know the value of
  arbitrary kconfigs at eval time.

---

Anyway, all that is to say: I'd like for this all to be better, but am
not willing to work on the kernel expressions myself at the moment, so
I thought I'd write down the reasons why this change was necessary,
and the extent of the problem.

We had already successfully considered this issue in one place in
`systemd/initrd.nix`, but it seems there are two more places where we
should have taken the same care.
2026-04-23 00:33:19 -04:00
Will Fancher
61d18372d6 nixos/systemd/initrd: Remove with lib 2026-04-23 00:33:19 -04:00
nixpkgs-ci[bot]
6c7ca5e567 Merge staging-next into staging 2026-04-22 18:24:38 +00:00
K900
911507e404 staging-nixos merge for 2026-04-22 (#512449) 2026-04-22 16:08:39 +00:00
confusedalex
9880f9dd70 nixos-init: fix example of extraBin 2026-04-22 16:04:14 +02:00
Arian van Putten
2fd3838ee4 nixos/systemd/initrd: fix modprobe (#512141) 2026-04-22 11:18:45 +00:00
nikstur
7fed7a400d nixos/systemd/initrd: fix modprobe
Contains the same fix as in d36077c0b6 but
now for the initrd.
2026-04-21 19:11:22 +02:00
nixpkgs-ci[bot]
dec7ed05b0 Merge staging-next into staging 2026-04-21 12:24:17 +00:00
nixpkgs-ci[bot]
65814f10db Merge master into staging-next 2026-04-21 12:23:46 +00:00
Paul Haerle
7482d9f889 nixos/switchable-system: improve switch-inhibitor pre-check (#510514) 2026-04-21 11:32:37 +00:00
Wroclaw
a8413bf805 nixos/luksroot: add timeout support for systemd-initrd 2026-04-19 20:07:45 +02:00
Wroclaw
50f1f692e4 nixos/luksroot: add global timeout option
this option defines default for each device timeout
2026-04-19 20:07:45 +02:00
Wroclaw
36f887ca90 nixos/luksroot: add timeout option for devices
This option allows for setting timeout on password prompt,
and upon reaching timeout, it will poweroff the system.
2026-04-19 20:07:44 +02:00
Ryan Lahfa
4a19f7be9f systemd: simplify and lose ballast (#509324) 2026-04-18 23:46:49 +00:00
nikstur
74f9684a0a nixos/systemd: include gpg in path for relevant units
Previously, this was patched directly into the systemd derivation. Now,
this is done via the module system. To make building systemd and
maintaining it simpler.
2026-04-19 01:31:46 +02:00
nixpkgs-ci[bot]
c0a9cc6492 Merge staging-next into staging 2026-04-16 18:26:33 +00:00
nixpkgs-ci[bot]
e08c3a8ded Merge master into staging-next 2026-04-16 18:26:01 +00:00
Bjørn Forsman
4afadc7355 nixos/luks: allow empty passphrases in prompt
LUKS itself supports empty passphrases, and NixOS even has
boot.initrd.luks.devices.<name>.tryEmptyPassphrase option, but still the
NixOS interactive LUKS passphrase prompt rejects empty passphrases.

Fix it.

Implementation note. The "open" command line is changed due to details
in how empty passphrases and trailing newlines are handled when reading
from stdin. This code path is only for the interactive prompt, not when
using keyfiles, and the "reuse passphrase" logic already strips trailing
newlines, so that's nothing new.
2026-04-16 18:48:44 +02:00
r-vdp
49c05db108 nixos/switchable-system: improve switch-inhibitor pre-check
The check ran `realpath /run/current-system` under errexit, so a
missing current-system symlink aborted the script.
Drop the realpath calls (the -f test and jq already follow symlinks)
and use a static store path for the empty fallback instead of mktemp/trap.

Also exempt dry-activate, which makes no state changes and was being
blocked from showing its diff, and let jq fail loudly on malformed
inhibitor JSON instead of silently treating it as empty.
2026-04-16 10:50:02 +02:00
nixpkgs-ci[bot]
3a1d2a0b86 Merge staging-next into staging 2026-04-15 18:26:42 +00:00
nixpkgs-ci[bot]
e63b66e482 Merge master into staging-next 2026-04-15 18:26:12 +00:00
Masum Reza
ee8d23b69a nixos/limine: pass distroName using JSON (#506929) 2026-04-15 17:43:10 +00:00
Jo
f35405eb12 nixos/system/activation: use structuredAttrs instead of passAsFile (#498925) 2026-04-15 14:35:39 +00:00
nixpkgs-ci[bot]
de1ff3af9c Merge staging-next into staging 2026-04-13 12:24:58 +00:00
nixpkgs-ci[bot]
f4569cec2d Merge master into staging-next 2026-04-13 12:24:26 +00:00
Florian Klink
ce5163a619 nixos/systemd-initrd: support omitting kernel parameter root (#506753) 2026-04-13 09:20:53 +00:00
nixpkgs-ci[bot]
4c0afb54e5 Merge staging-next into staging 2026-04-13 00:31:18 +00:00
nixpkgs-ci[bot]
f3d15920b7 Merge master into staging-next 2026-04-13 00:30:41 +00:00
Martin Weinelt
3de9963aa8 Merge staging-nixos into master (#509394) 2026-04-12 21:49:23 +00:00
nikstur
2610f08d3d nixos/systemd: fix socket sshd-vsock (#509055) 2026-04-12 18:43:40 +00:00
Christian Kögler
c6e01cc838 nixos/systemd: fix socket sshd-vsock 2026-04-12 09:27:19 +02:00
nixpkgs-ci[bot]
27c3e94446 Merge master into staging-nixos 2026-04-12 00:30:54 +00:00
nixpkgs-ci[bot]
f64424d9a1 Merge staging-next into staging 2026-04-12 00:30:24 +00:00
nixpkgs-ci[bot]
63496be1d6 Merge master into staging-next 2026-04-12 00:29:50 +00:00
nikstur
608a94df15 nixos/logind: only enable if systemd-logind was built (#508968) 2026-04-11 19:41:37 +00:00
nikstur
b29e9123ac nixos/tmpfiles: fix layer inversion (#507873) 2026-04-11 19:09:03 +00:00
Sam Pointon
913747b843 nixos/logind: only enable if systemd-logind was built 2026-04-11 20:03:44 +01:00
nixpkgs-ci[bot]
19a8c59cb8 Merge staging-next into staging 2026-04-11 16:38:23 +00:00
nixpkgs-ci[bot]
49fa0e0243 Merge master into staging-next 2026-04-11 16:37:46 +00:00
nixpkgs-ci[bot]
e0d9a8d903 Merge master into staging-nixos 2026-04-11 12:12:40 +00:00
nixpkgs-ci[bot]
9d1be0eeff Merge staging-next into staging 2026-04-11 12:12:07 +00:00
nixpkgs-ci[bot]
ed5803a2ab Merge master into staging-next 2026-04-11 12:11:38 +00:00
nikstur
205b13add2 nixos/systemd: fix service sshd-vsock@ (#508855) 2026-04-11 10:46:21 +00:00
Christian Kögler
eaa2277e8d nixos/systemd: fix service sshd-vsock@ 2026-04-11 08:30:29 +02:00
Ryan Lahfa
d3aa6844e5 systemd: drop most patches (#488508) 2026-04-10 21:42:03 +00:00
nixpkgs-ci[bot]
895e8ce67f Merge master into staging-nixos 2026-04-10 18:19:13 +00:00
nixpkgs-ci[bot]
80dd94e004 Merge master into staging-next 2026-04-10 18:18:09 +00:00