Commit Graph

3194 Commits

Author SHA1 Message Date
André Silva
5c6681a09d nixos/kernel: add xhci_pci_prom21 to default initrd modules on linux 7.2
Since 7.2, xhci-pci defers AMD 800-series chipset xHCI controllers
(1022:43fc/43fd) to the new xhci_pci_prom21 driver and no longer binds
them itself.
2026-08-17 11:57:36 +01:00
Aliaksandr
6ccc493231 nixos/limine: drop dead FWUPD_EFIAPPDIR override
fwupd stopped honouring the FWUPD_EFIAPPDIR environment variable in
https://github.com/fwupd/fwupd/pull/9846; the location is a compile-time
constant (`EFI_APP_LOCATION`) since then, so setting the variable on
fwupd.service had no effect.

Drop `RuntimeDirectory` from the signing unit too: the directory is now
created and populated by the fwupd module, and RuntimeDirectoryPreserve
defaults to `no`, so systemd removed it (together with the unsigned app)
whenever the unit stopped -- which `partOf = fwupd.service` makes happen
on every fwupd restart.

Cover the whole path in the limine secure boot test, which so far never
enabled fwupd: it now asserts that both the unsigned app and the signed
variant end up in /run/fwupd-efi.

Assisted-by: claude-code with claude-opus-5[1m]-high
2026-08-16 01:42:28 +03:00
nixpkgs-ci[bot]
7676da2de4 Merge staging-next into staging 2026-08-04 18:32:58 +00:00
Will Fancher
e087b1f0d9 nixos/systemd-initrd: disambiguate doc for root="gpt-auto" (#548753) 2026-08-04 18:26:32 +00:00
nixpkgs-ci[bot]
70362feb37 Merge staging-next into staging 2026-08-04 00:33:06 +00:00
Arne Keller
3cb7b547a6 nixos/stage-1: make "testing patched programs" build output more useful (#524902) 2026-08-03 21:45:06 +00:00
nixpkgs-ci[bot]
258fffa55f Merge staging-next into staging 2026-08-03 13:03:34 +00:00
Antoine Cotten
d6e843ab30 nixos/systemd-initrd: disambiguate doc for root="gpt-auto" 2026-08-03 11:56:07 +02:00
nixpkgs-ci[bot]
c21e7eea53 Merge master into staging-nixos 2026-08-02 18:21:34 +00:00
nixpkgs-ci[bot]
22e2bd08e1 Merge staging-next into staging 2026-08-02 18:21:07 +00:00
Morgan Jones
764a4ebdf2 nixos/limine: don't read all of /nix/store during installation
The installer being placed directly at (e.g.)
/nix/store/272h8d4df6by64ycl3s01bixrcaq5a9a-limine-install.py causes
Python to search the script's directory for imports if -P is not added,
so add -P to avoid Python automatically adding /nix/store to the script's
sys.path.

From the python manpage:

> -P: Don't automatically prepend a potentially unsafe path to sys.path
> such as the current directory, the script's directory or an empty string.
> See also the PYTHONSAFEPATH environment variable.
2026-08-02 05:24:15 -07:00
dram
340d0b52ac nixos/systemd: generate boot random seed with config esp path (#535538) 2026-08-01 14:49:47 +00:00
Grimmauld
4f3ddb8353 Revert "nixos/systemd: patch to avoid update-utmp failure with audit 4.2"
This reverts commit 693e3bc415.
2026-07-30 08:24:25 +02:00
whispers
693e3bc415 nixos/systemd: patch to avoid update-utmp failure with audit 4.2
audit 4.2 rejects overlong values (max 15 bytes) for the kernel comm.
systemd attempts to send the full 19 bytes of "systemd-update-utmp",
and the systemd-update-utmp service fails to start. this was changed to
truncate instead of reject in audit 4.2.1, but until we can take the
mass rebuild on staging, we fetch the systemd patch which shortens
"systemd-update-utmp" to "update-utmp". this is in the nixos module as
`apply` instead of part of the systemd package as that would be a larger
rebuild and would delay other fixes making their way to master.
2026-07-29 17:25:41 -04:00
Grimmauld
38007d355a nixos/resolved: filter null values from config (#546801) 2026-07-29 10:12:46 +00:00
Elliot Berman
e949e86001 nixos/uki: allow deviceTree to be excluded from UKI
When setting `hardware.deviceTree.name` and `.enable`, a DeviceTree
section is added to UKI. This is nice default behavior for arm64
systems. When `hardware.deviceTree.package` plumbs into UEFI firmware
(e.g. u-boot), the UKI replaces the UEFI-supplied DTB. Besides bloating
the UKI, this has the side-effect of preventing UEFI firmware from
making modifications to the devicetree.

Filter out null boot.uki.settings values so that a NixOS configuration
can set `boot.uki.settings.UKI.DeviceTree = null;` to remove the default
behavior of packing the dtb into the UKI.
2026-07-28 14:47:39 -07:00
Grimmauld
61e5a270ca nixos/resolved: filter null values from config
There is valid scenarios to NOT have certain keys in /etc/resolved.conf, e.g. WSL mDNS.
This was reported in https://github.com/NixOS/nixpkgs/pull/535649#issuecomment-5103574775.
Empty configs can still be achieved passing an empty list (`[]`) or empty string (`""`),
while passing `null` will now remove the key from the config file.
2026-07-28 21:30:17 +02:00
Sam Pointon
629b4ee093 systems: rename extant wasi targets to wasip1
Wasi P2 is different enough to Wasi P1 to warrant being treated entirely 
separately, rather than as two minor variants of the same thing. P3 will 
likewise want to be a different target.

I've left aliases in place; maybe eventually, those can be deprecated 
and removed. I've tested this, but it's possible there might be breakage 
somewhere (e.g., the canonical doubles for P1 have changed, though I 
can't imagine why anyone would rely on that).

Fixes https://github.com/NixOS/nixpkgs/issues/435954
2026-07-28 19:50:03 +01:00
Eman Resu
5c483d4767 various: partially apply prefix/suffix/infix checks (#543869) 2026-07-26 21:41:24 +00:00
Martin Weinelt
4e2415b3c2 nixos/systemd-resolved: apply transformation to resolve section
In a previous change the transformSettings function was modified to look
at the Resolve section, but since it got a second consumer in the mean
time this regressed. We now target the resolved.conf explicitly instead.
2026-07-24 23:22:47 +02:00
Martin Weinelt
9f42db501a Revert "nixos/resolved: apply transformations to keys within resolved section"
This reverts commit 66353ca989.

In the meantime a new option was added that consumes the
`transformSettings` function, which broke by looking at just at the
Resolve section.
2026-07-24 23:01:22 +02:00
Martin Weinelt
9351f979e0 nixos/resolved: apply transformations to keys within resolved section (#535649) 2026-07-23 01:00:19 +00:00
Eman Resu
e0a601e1f7 nixos/tmpfiles: partially apply hasPrefix and removePrefix calls 2026-07-20 10:28:43 -04:00
nixpkgs-ci[bot]
866d350c81 Merge master into staging-nixos 2026-07-17 00:33:21 +00:00
nikstur
412c6fbc6e nixos/systemd/tpm2: add systemd-pcrlogin@.service (#541382) 2026-07-16 21:47:04 +00:00
Nick Cao
23171017c7 nixos/plymouth: add showDelay option (#532392) 2026-07-16 19:23:35 +00:00
nikstur
974b31ae59 nixos/systemd/fido2: add libpcsclite_real.so.1 to initrd (#541383) 2026-07-16 19:09:11 +00:00
phanirithvij
4abe0c81a7 various: replace deprecated os.system with subprocess calls
Signed-off-by: phanirithvij <phanirithvij2000@gmail.com>
2026-07-13 16:27:07 +05:30
r-vdp
503bfeb10f nixos/systemd/fido2: add libpcsclite_real.so.1 to initrd
libfido2 links against pcsclite's libpcsclite.so.1, which since
pcsclite 2.3.1 is a shim that dlopens libpcsclite_real.so.1. nixpkgs
patches that dlopen to an absolute store path. make-initrd-ng only
follows DT_NEEDED, so the real library never ends up in the initrd.

systemd-cryptsetup then logs at boot:

  loading ".../pcsclite-2.4.1-lib/lib/libpcsclite_real.so.1" failed:
  cannot open shared object file: No such file or directory

and FIDO2 tokens behind PC/SC (NFC readers) cannot be used to unlock
LUKS in stage 1. Add the real library to the initrd store paths.
2026-07-13 12:54:41 +02:00
r-vdp
74abe2fea2 nixos/systemd/tpm2: add systemd-pcrlogin@.service
systemd v261 added systemd-pcrlogin@.service, which logind starts on
first login of a user to measure the user record into the 'login'
NvPCR. NixOS does not install the unit, so every first login logs:

  systemd-logind: Failed to start user measurement service
  'systemd-pcrlogin@1000.service', ignoring: Unit not found.

Install the unit on systems with systemd.tpm2.enable. The unit has ConditionSecurity=measured-os and does nothing elsewhere.
2026-07-13 12:54:32 +02:00
Florian Klink
22ef2ba154 nixos/limine: fix location for boot.loader.limine.additionalFiles
The documentation describes this as a set of files copied to /boot, with
the attribute name denoting the destination file name in /boot.

This uses essentially the same description as refind, systemd-boot and
grub. However limine put it into limine_install_dir (/boot/limine by
default) by accident, which broke downstream users.

For example, nixos-apple-silicon uses boot.loader.limine.additionalFiles
(and similar directives for other bootloaders) to update its m1n1
bootloader (which chainloads into u-boot, which chainloads into the
bootloader selected in NixOS), and due to this bug, put new versions of
it in the wrong location, effectively never updating m1n1.

Fix this, by updating the location. The next commit adds a regression VM
test for it.
2026-07-07 23:14:45 +03:00
r-vdp
bb258c2dbe nixos/systemd-boot: update via Varlink instead of parsing bootctl status
systemd v261 lists the new systemd-boot-fallback binary in `bootctl
status`, so our regex picked up the older fallback version and ran
`bootctl update` on an already current ESP, which then exits non-zero.

Switch from parsing the `bootctl --status` output to having bootctl
compare versions itself by calling io.systemd.BootControl.Install over
Varlink. bootctl is spawned as a stdio Varlink server so that we always
use the bootctl from the target closure. An already current binary comes
back as an io.systemd.System error carrying ESTALE, which we treat as
success.
2026-07-01 12:08:51 +02:00
Martin Weinelt
66353ca989 nixos/resolved: apply transformations to keys within resolved section
Because all options are below the [Resolve] section, and we nest them as
such below `settings.Resolve` we need to apply the transformations one
level down for it to match the relevant keys.
2026-06-26 15:06:21 +02:00
nixpkgs-ci[bot]
081f72db10 Merge master into staging-nixos 2026-06-26 12:46:27 +00:00
Florian Klink
d2bde3cf5a Allow to pass extra initrd archives to the bootloader (#534265) 2026-06-26 10:46:37 +00:00
r-vdp
5f267f4dda nixos/boot: allow passing extra initrd archives to the bootloader
This is for instance useful on Asahi where an additional initrd archive
containing firmware blobs and per-device calibration files is placed
on the ESP and updated by the Asahi Linux Installer.
These need to be loaded alongside the NixOS initrd.

Implemented for systemd-boot and Limine. Grub is left out since its
install script does not use bootspec yet.

Co-authored-by: Florian Klink <flokli@flokli.de>
2026-06-26 13:39:08 +03:00
5aaee9
4ffc664cd1 nixos/systemd: generate boot random seed with config esp path 2026-06-26 18:10:13 +08:00
r-vdp
5640e1f935 nixos/limine: add extraInstallCommands option
Allows running additional shell commands after the limine install script
generates menu entries, mirroring the systemd-boot option of the same
name.

Co-authored-by: Florian Klink <flokli@flokli.de>
2026-06-25 22:58:22 +02:00
nixpkgs-ci[bot]
68cd6bba16 Merge master into staging-nixos 2026-06-25 18:47:24 +00:00
nixpkgs-ci[bot]
42814ad4b8 Merge master into staging-next 2026-06-25 18:46:06 +00:00
Arian van Putten
37d4094e73 nixos/systemd/tmpfiles: add credstore.conf (#534998) 2026-06-25 16:23:49 +00:00
Arian van Putten
921383b2ce nixos/journald-{gateway,remote}: remove TLS support
We aren't linking systemd to gnutls anymore so these options
were all silently ignored. Which is pretty bad!

Assisted-by: Claude <noreply@anthropic.com>
2026-06-25 15:47:45 +02:00
Arian van Putten
3d47d8331a nixos/systemd: add many Varlink APIs since v260 (#533730) 2026-06-25 08:06:37 +00:00
Raito Bezarius
588eb06fcc nixos/systemd/tpm2/pcrextend: add Varlink API
This adds io.systemd.PCRExtend if the system has TPM2
enabled.

Additionally, this requires the system to fullfill
ConditionSecurity=measured-uki.

Change-Id: I3f1046cdc7463f3b6d3205030f7f12ac95e5cd9e
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2026-06-25 09:50:39 +02:00
Raito Bezarius
13684b8470 nixos/systemd/resolved: add Varlink APIs
This adds:

- /run/systemd/resolve/io.systemd.Resolve (resolution)
- /run/systemd/resolve/io.systemd.Resolve.Monitor (monitoring)

Change-Id: I43f22be5c42757f3dad1e4a9d209b0a91f404a55
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2026-06-25 09:50:38 +02:00
Raito Bezarius
5c6a1e2b3d nixos/systemd/udevd: add Varlink API
This adds io.systemd.Udev by default.

Change-Id: I41fec3831049aec03041a9ac8a282088e1773b79
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2026-06-25 09:50:38 +02:00
Raito Bezarius
04f7553ac2 nixos/systemd/networkd: add Varlink APIs
This adds:

- /run/systemd/resolve.hook/io.systemd.Network (DNS hook)
- /run/systemd/report/io.systemd.Network (metrics)
- /run/systemd/netif/io.systemd.Network (management)

Change-Id: I3d63b0723ae5f8f9496418d8f5d857809302155e
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2026-06-25 09:50:38 +02:00
Raito Bezarius
b8b65f1616 nixos/systemd/factory-reset: add Varlink API
This adds io.systemd.FactoryReset by default.

Change-Id: I2ef8ae8812e76bc81a5f962e9bfeb99967f6df83
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2026-06-25 09:50:38 +02:00
Raito Bezarius
65cdcfc133 nixos/systemd/mute-console: add Varlink API
This adds io.systemd.MuteConsole by default.

Change-Id: I613d5f12e5b2742206c3023e4d57ccdfbaf0e704
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2026-06-25 09:50:38 +02:00
Raito Bezarius
ff55fdd003 nixos/systemd/machined: add Varlink API
This adds io.systemd.Machine by default.

Change-Id: I05e595d22ad06504e2b3aacb48c74e7683057ce3
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2026-06-25 09:50:38 +02:00