Commit graph

2835 commits

Author SHA1 Message Date
h7x4 4ba3f60b8a
various: use mkPackageOption 2025-09-22 02:46:54 +02:00
K900 be0b9e1bff Merge remote-tracking branch 'origin/staging-next' into staging 2025-09-19 07:49:55 +03:00
Franz Pletz 6e3bccdd2d
nixos/systemd: add units for capsule support 2025-09-17 21:41:43 +02:00
nixpkgs-ci[bot] 94ce9acecb
Merge staging-next into staging 2025-09-15 18:06:28 +00:00
misuzu 72f6935afb
nixos/plymouth-tpm2-totp: init (#424861) 2025-09-15 16:27:55 +00:00
Majiir Paktu b5bbf6f901 nixos/plymouth-tpm2-totp: init 2025-09-15 12:22:54 -04:00
nixpkgs-ci[bot] 85b587287b
Merge staging-next into staging 2025-09-15 12:07:44 +00:00
r-vdp c4753ff331
nixos/systemd-boot-builder: make sure to print informational messages to stderr
Otherwise this gets printed to stdout when running things like
nixos-rebuild, while people rely on the toplevel store path being the only
output of such commands.
2025-09-15 10:19:15 +02:00
Chet Gurevitch 148d76c0b9 nixos/stage-1: always include util-linux mount
- respect X-mount.subdir option
- fix mount test redirection (1>&1 to 2>&1)
2025-09-14 23:05:06 -07:00
Will Fancher f1f9ee2028
nixos/systemd: introduce settingsToSections util, migrate existing rfc42 options to use settingsToSections, migrate oomd to rfc42 (#437477) 2025-09-12 03:41:59 +00:00
Rane 77448445c1 nixos/limine: fix install script when using Xen with EFI (#441473) 2025-09-10 08:55:40 +10:00
John Titor 5d9e8f43d7 nixos/refind: allow use only on UEFI platforms 2025-09-06 12:29:15 +05:30
Tristan Ross 062b58f36f nixos/refind: init 2025-09-06 12:29:15 +05:30
Jared Baur 231bf43f72
nixos/systemd-boot-builder: remove old devicetree files (#439585) 2025-09-03 15:33:13 +01:00
Jeremy Fleischman 683d9e3b54
nixos/systemd-boot-builder: remove old devicetree files
I just stumbled across this during code inspection. I haven't tested
this at all.
2025-09-03 13:35:57 +01:00
Acid Bong 68dacf00f4 nixos/limine: use SBctl from the option 2025-09-03 01:12:09 +05:30
Paul Haerle 160448060e
Add Xen multiboot kernel to bootspec and package, refactor boot options, add xen bootspec support to Limine (#393287) 2025-09-02 13:07:11 +02:00
Will Fancher 1782471af1
nixos/plymouth: Fix emergency / rescue mode. (#439447) 2025-09-02 07:57:39 +00:00
Will Fancher 73c52fbf7b nixos/plymouth: Pull ask-password in sysinit
This mirrors 'systemd-ask-password-console.path'
2025-09-02 03:40:03 -04:00
Will Fancher 825442f5cd nixos/plymouth: Fix rescue / emergency mode not quitting plymouth 2025-09-02 02:50:43 -04:00
Ali Rizvi c372a3fbe9
nixos/systemd-oomd: add After=swap.target to fix swap detection issues
This should be removed after systemd 258 releases, as it is a temporary drop-in fix to circumvent the issue of systemd-oomd failing to detect a valid swap (noticeable in cases of users using `zram` as swap).

I've taken the liberty to clarify which `After=` override should be dropped when, based on the systemd version on Nixpkgs.
2025-08-31 16:19:35 -04:00
yunfachi ae0f69acb9
nixos/plymouth: use system.nixos.distroName in nixosBreezePlymouth 2025-08-30 14:33:56 +03:00
Rane 647c04f2e9 nixos/limine: Add support for booting Xen 2025-08-30 14:43:43 +10:00
Sandro Jäckel e9e0a0984f
nixos/plymouth: dedupe theme check 2025-08-30 02:01:35 +02:00
Sandro Jäckel c7c502a5fc
nixos/plymouth: list available themes if the current one does not exist 2025-08-30 00:25:41 +02:00
Sandro Jäckel 7dbd50832a
nixos/plymouth: fix theme == "breeze" breakage after removing Plasma 5 2025-08-30 00:25:38 +02:00
Philip Taron 54a65ab16f
nixos/systemd-initrd: silence various warnings (#432704) 2025-08-28 15:53:59 -07:00
Alyssa Ross bcd38e11bf nixos/systemd: fix enabling non-existent service
This service doesn't exist when withBootLoader is false.

Fixes: 2c98ea1e33 ("nixos/systemd: add upstream units for boot counting")
2025-08-28 12:29:48 +02:00
Grimmauld 1dfd249772
nixos/systemd-oomd: align DefaultMemoryPressureDurationSec with upstream systemd 2025-08-27 12:55:53 +02:00
Grimmauld 1f1ef6bd08
nixos/systemd-oomd: migrate extraConfig to systemd-respecting rfc42 settings.OOM 2025-08-27 12:54:51 +02:00
Grimmauld 55f3ead194
nixos/logind: write services.logind.settings using settingsToSections 2025-08-27 12:42:08 +02:00
Grimmauld 51ac6e36ba
nixos/systemd: write boot.initrd.systemd.settings using settingsToSections 2025-08-27 12:39:35 +02:00
Grimmauld 98c8230c88
nixos/systemd: write systemd.settings using settingsToSections 2025-08-27 12:39:01 +02:00
Philip Taron e1e38fdab8
nixos/networkd: allow setting ManageForeignNextHops option (#376630) 2025-08-26 13:10:21 -07:00
Florian Klink cadd6c49ee
nixos/systemd-user: enable systemd-tmpfiles-clean.timer (#391976) 2025-08-26 11:34:47 +03:00
r-vdp 2c98ea1e33
nixos/systemd: add upstream units for boot counting
These units are needed to be able to experiment with systemd's boot counting
functionality (e.g. with out-of-tree bootloaders like lanzaboote), and they
cannot easily be added through configuration without patching nixpkgs.
They are basically a no-op when boot entries do not contain any
counters, so AFAICT there is no disadvantage to them being enabled by default.
2025-08-25 22:26:52 +03:00
dish 970dcca69c
treewide: Fix links in module documentation 2025-08-25 12:55:11 -04:00
Florian Klink 6d3383c9e3
nixos/logind: migrate to settings option (#435407) 2025-08-25 13:31:13 +03:00
Felix Buehler 89526e1171 nixos/logind: migrate to settings option 2025-08-24 18:52:40 +02:00
schnusch 44c7414cc6 nixos/systemd-user: add systemd.user.tmpfiles.enable
enabled by default, see #391976
2025-08-22 17:52:13 +02:00
schnusch 5241898a20 nixos/systemd-user: enable systemd-tmpfiles-clean.timer
Set systemd.user.timers.systemd-tmpfiles-clean.wantedBy when any user tmpfiles
rules are set so NixOS knows to enable the unit.
2025-08-22 17:47:17 +02:00
nixpkgs-ci[bot] d263613f2e
Merge master into staging-next 2025-08-22 12:06:42 +00:00
Luj 30f409ed23
nixos/systemd-boot-builder: use pathlib.Path where possible (#434767) 2025-08-22 10:27:08 +01:00
K900 31d5c4e753 nixos/treewide: clean up some more references to deleted qt5 things 2025-08-22 11:38:49 +03:00
nixpkgs-ci[bot] 53fe08332e
Merge master into staging-next 2025-08-21 20:43:13 +00:00
K900 35d0bafabf nixos/treewide: clean up Plasma 5 references
Preparing to drop.
2025-08-21 22:31:56 +03:00
budimanjojo 59f0f1e7ea
nixos/networkd: allow setting ManageForeignNextHops option
Signed-off-by: budimanjojo <budimanjojo@gmail.com>
2025-08-21 02:22:06 +07:00
nixpkgs-ci[bot] 8721febb4b
Merge master into staging-next 2025-08-20 00:16:19 +00:00
Will Fancher bf9cb5e0d4
nixos/boot/kernel: allow kernel without MODULES support (#411792) 2025-08-19 21:28:36 +00:00
Linus Heckemann f2ca990558 nixos/systemd-boot-builder: use pathlib.Path where possible
`switch-to-configuration boot` was taking suspiciously long on a machine
of mine where the boot partition is on a slow SD card. Some tracing led
me to discover that it was in fact deleting all the kernels and initrds
every time, only to rewrite them.

This turned out to be because of the naive (non-path-normalising) string
concatenation used to construct paths in `known_paths`, so all the files
were recognised as obsolete and deleted:


known_paths=['/EFI/nixos/5jz3m9df1cbxn4hzjjs3aaz8lb9vvimc-linux-6.15.7-Image.efi', '/EFI/nixos/xri8qzfvzclf89x7nfwgq248miw7jbp0-initrd-linux-6.15.7-initrd.efi', '/EFI/nixos/b18llskzrcdgw2nbib58qqcaabiik6yc-linux-6.16-Image.efi', '/EFI/nixos/mdj53j746bii1vw227dfhkyd8ajwab2w-initrd-linux-6.16-initrd.efi', '/EFI/nixos/b18llskzrcdgw2nbib58qqcaabiik6yc-linux-6.16-Image.efi', '/EFI/nixos/mdj53j746bii1vw227dfhkyd8ajwab2w-initrd-linux-6.16-initrd.efi', '/EFI/nixos/b18llskzrcdgw2nbib58qqcaabiik6yc-linux-6.16-Image.efi', '/EFI/nixos/mdj53j746bii1vw227dfhkyd8ajwab2w-initrd-linux-6.16-initrd.efi', '/EFI/nixos/5jz3m9df1cbxn4hzjjs3aaz8lb9vvimc-linux-6.15.7-Image.efi', '/EFI/nixos/1ihk03c1i5518hlgm5mnhrig2hy3hq24-initrd-linux-6.15.7-initrd.efi', '/EFI/nixos/5jz3m9df1cbxn4hzjjs3aaz8lb9vvimc-linux-6.15.7-Image.efi', '/EFI/nixos/1ihk03c1i5518hlgm5mnhrig2hy3hq24-initrd-linux-6.15.7-initrd.efi', '/EFI/nixos/5jz3m9df1cbxn4hzjjs3aaz8lb9vvimc-linux-6.15.7-Image.efi', '/EFI/nixos/1ihk03c1i5518hlgm5mnhrig2hy3hq24-initrd-linux-6.15.7-initrd.efi']
path='/boot//EFI/nixos/5jz3m9df1cbxn4hzjjs3aaz8lb9vvimc-linux-6.15.7-Image.efi'
path='/boot//EFI/nixos/xri8qzfvzclf89x7nfwgq248miw7jbp0-initrd-linux-6.15.7-initrd.efi'
path='/boot//EFI/nixos/b18llskzrcdgw2nbib58qqcaabiik6yc-linux-6.16-Image.efi'
path='/boot//EFI/nixos/mdj53j746bii1vw227dfhkyd8ajwab2w-initrd-linux-6.16-initrd.efi'
path='/boot//EFI/nixos/1ihk03c1i5518hlgm5mnhrig2hy3hq24-initrd-linux-6.15.7-initrd.efi'


This can be avoided by using pathlib.Path, which normalises paths and
generally provides a more consistent and convenient API. I therefore
went ahead and replaced all use of `str` for path handling with `Path`
in the builder. This may fix some other, similar bugs, as well, but I
haven't checked in detail.
2025-08-18 20:11:57 +02:00
K900 f4924fc36c Merge remote-tracking branch 'origin/master' into staging-next 2025-08-16 09:11:21 +03:00
Jared Baur ca9040f22c
nixos/kernel: obtain in-tree kernel modules via the modules output 2025-08-15 20:56:59 -07:00
andre4ik3 216d98ab97
nixos/systemd-initrd: silence various warnings
Silences 2 warning messages that appear when using the systemd initrd:

1. "System tainted (var-run-bad)": occurs because `/var/run` isn't a
   symlink to `/run`. Fixed by making /run and linking /var/run to it.

2. "Failed to make /usr a mountpoint": occurs because ProtectSystem
   defaults to true in the initrd, which makes systemd try to remount
   `/usr` as read-only, which doesn't exist in the initrd. Fixed by
   linking `/usr/bin` and `/usr/sbin` to the initrd bin directories.

Also moves the `/tmp` creation from the initrd module to make-initrd-ng,
to avoid making an unnecessary `/tmp/.keep`, saving a store path and a
few bytes in the initrd image.
2025-08-16 00:28:13 +00:00
Martin Weinelt ab44040de2
Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
	pkgs/development/python-modules/reflex-hosting-cli/default.nix
	pkgs/development/python-modules/reflex/default.nix
2025-08-16 00:32:32 +02:00
Florian Klink 2804350633
nixos/systemd/{homed,userdbd}: add module options, SSH integration support (#432439) 2025-08-15 22:35:54 +02:00
Colin d538aa4a55
nixos/grub: install memtest and other grub.extraFiles correctly when using mirroredBoots (#420861) 2025-08-15 19:01:26 +00:00
andre4ik3 8fdcd28f9d
nixos/systemd/userdbd: add warning for system users >= UID 1000
When a disposition is not set in a user record, systemd determines user
disposition depending on the range the user's UID falls in. For system
users with UIDs above 1000, this will cause them to be incorrectly
identified as "regular" users.

This will cause `userctl` to report the user as a regular user, and more
importantly, `systemd-homed` will not run the first boot user creation
flow, as regular users are already present on the machine (when they are
really system users).

The most common source of high UID system users will undoubtedly be Nix
build users, so the warning provides additional guidance on how to
remove them or adjust their IDs to be within the system range.

The warning is shown only when userdbd/homed is enabled, and the option
to hide the warning is deliberately hidden, to ensure users will have to
read and acknowledge the warning before proceeding, as otherwise users
could end up deploying an OS with no users and no way of creating one
due to the first boot flow being skipped.
2025-08-15 16:17:58 +00:00
andre4ik3 21a816c3ce
nixos/systemd/homed: add module options, SSH integration support 2025-08-15 16:17:51 +00:00
Fiona Behrens c8e3d79271 nixos/boot/kernel: allow kernel without MODULES support
Allow building a systemd initrd with a kernel that does not have
modules support enabled (`CONFIG_MODULES=n`), by removing the
assertion and only include the modulesClosure, kmod and support files
if MODULES is enabled or unset in the kernel.
2025-08-11 13:39:29 +00:00
nikstur e63a403bfb nixos/kernel: don't include append-initrd-secrets when unused 2025-08-10 22:43:48 +02:00
nikstur 9e0ac0c7e6 nixos/kexec: add enable option
It is still enabled by default but now you can actively exclude it if
you don't need it.
2025-08-10 22:43:34 +02:00
nikstur d5ae87bdeb
Revert "nixos: allow more things to be disabled" 2025-08-10 22:22:08 +02:00
nixpkgs-ci[bot] d50fd904cb
Merge master into staging-next 2025-08-10 18:05:04 +00:00
Arian van Putten 1bb040fae8
nixos: allow more things to be disabled (#429695) 2025-08-10 19:49:52 +02:00
Martin Weinelt 98214d19e0
Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
	pkgs/development/python-modules/django-stubs-ext/default.nix
	pkgs/development/python-modules/django-stubs/default.nix
	pkgs/development/python-modules/python-roborock/default.nix
2025-08-10 14:46:08 +02:00
K900 aadb3e60ec
linux: remove mentions of extraStructuredConfig & throw error (#432497) 2025-08-10 15:16:42 +03:00
Maximilian Bosch dccb264578
linux: remove mentions of extraStructuredConfig & throw error
PR #431115 changed extraStructuredConfig to structuredExtraConfig to
follow the deprecation warning about `extraConfig`. However,
`extraStructuredConfig` was mentioned in several places in the docs that
weren't addressed. Also, using this would silently fail since the code
in question would still accept the old key.

This patch updates the docs accordingly and throws an error if the
code-path is reached and `extraStructuredConfig` is being used.
2025-08-10 14:10:50 +02:00
andre4ik3 d54387fcd0
nixos/systemd/userdbd: add SSH integration support 2025-08-10 05:21:10 +00:00
andre4ik3 07d5f80dcb
nixos/systemd: add NSS module to shadow database 2025-08-10 05:21:00 +00:00
nixpkgs-ci[bot] ca321b05ae
Merge staging-next into staging 2025-08-09 18:05:59 +00:00
Ryan Lahfa bcc20cad16
nixos/network-interfaces: let networkd handle privacy extensions (#431967) 2025-08-09 17:53:39 +02:00
nikstur bb954cddf5 nixos/network-interfaces: let networkd handle privacy extensions
This removes bash from the mandatory system closure.
2025-08-09 00:10:13 +02:00
nixpkgs-ci[bot] 230bb9a8b7
Merge staging-next into staging 2025-08-01 18:06:57 +00:00
Alex Lyon 38ee02a873 nixos/limine: fix installation when using initrd secrets 2025-08-01 21:59:49 +05:30
nikstur cc20f14ae4 nixos/kexec: add enable option
It is still enabled by default but now you can actively exclude it if
you don't need it.
2025-08-01 14:16:48 +02:00
nikstur 400882d409 nixos/kernel: don't include append-initrd-secrets when unused 2025-07-31 20:42:36 +02:00
nixpkgs-ci[bot] 0b79387651
Merge staging-next into staging 2025-07-30 12:11:23 +00:00
Will Fancher 0a53886700
nixos/{tmpfiles, wrappers}: explicitly set RestrictSUIDSGID false (#426882) 2025-07-30 04:31:21 -04:00
nixpkgs-ci[bot] 44dfdaf4d6
Merge staging-next into staging 2025-07-29 00:20:45 +00:00
Grimmauld fad6dbb9e6
nixos/systemd: remove enableCgroupAccounting option 2025-07-28 11:26:44 +02:00
Grimmauld 231c142766
nixos/systemd: remove obsolete DefaultCPUAccounting option
This option is made uncondiotional in systemd 258 [1].
Earlier, it defaulted to true on kernels newer than 4.15,
which applies to all supported nixos kernels.
This means removing the option does not change behavior.

[1] 29da53dde3
2025-07-28 11:26:37 +02:00
Grimmauld f47b100763
nixos/systemd: remove obsolete DefaultBlockIOAccounting option
This option is now being ignored by systemd,
so we do not need to explicitly define it.
2025-07-28 11:26:34 +02:00
Grimmauld 265152f770
nixos/systemd: explicitly set systemd.settings.Manager.Default*Accounting 2025-07-28 11:26:30 +02:00
Grimmauld 9c429f004d
nixos/systemd: remove obsolete definition for DefaultLimitCORE
The limit was introduced in 2016 in 840f3230a2,
and broken iin 2019 in bafc256915. Since then,
it is the exact same as systemd itself sets as default.
2025-07-28 11:26:27 +02:00
Grimmauld 69e833f187
nixos/systemd: set DefaultLimitCORE in systemd.settings.Manager explicitly 2025-07-28 11:26:24 +02:00
Grimmauld 62acc59148
nixos/systemd: move systemd.watchdog.* to systemd.settings.Manager 2025-07-28 11:26:21 +02:00
Grimmauld 493f1339b0
nixos/systemd: move systemd.watchdog.* to systemd.settings.Manager 2025-07-28 11:26:08 +02:00
Grimmauld 4d3ab0e8d3
nixos/systemd: make systemd.managerEnvironment affect systemd.settings.Manager 2025-07-28 11:24:39 +02:00
Grimmauld 897933fc9e
nixos/systemd: move systemd.managerEnvironment to systemd.settings.Manager.ManagerEnvironment 2025-07-28 11:24:36 +02:00
Grimmauld 5bc2d42ba9
nixos/systemd: make boot.initrd.systemd.managerEnvironment affect boot.initrd.systemd.settings.Manager 2025-07-28 11:24:33 +02:00
Grimmauld 071ce0b44a
nixos/systemd: remove boot.initrd.systemd.extraConfig 2025-07-28 11:24:29 +02:00
Grimmauld 1a846a2fff
nixos/systemd: remove systemd.extraConfig 2025-07-28 11:24:26 +02:00
Grimmauld f0b71eebdc
nixos/systemd: add boot.initrd.systemd.settings.Manager option 2025-07-28 11:24:06 +02:00
Grimmauld ebaf7a33ec
nixos/systemd: add settings.Manager option 2025-07-28 11:23:57 +02:00
nixpkgs-ci[bot] 358926051b
Merge staging-next into staging 2025-07-28 06:08:00 +00:00
Will Fancher 4b3b18a44f
nixos/systemd-boot: refactor json.load() logic for better error message (#421916) 2025-07-27 23:08:42 -04:00
jack dedf852ccd nixos/systemd-boot: refactor json.load() logic for better error message 2025-07-27 13:05:03 +02:00
nixpkgs-ci[bot] e7367619eb
Merge staging-next into staging 2025-07-26 18:05:47 +00:00
Grimmauld fb51cc802d
nixos/systemd: run0: enable setLoginUid, disable pamMount
This brings our `run0` in line with the upstream defaults:
bcc73cafdb/src/run/systemd-run0.in

While working on `auditd`, i noticed differences in how `run0` behaves
in regard to `/proc/$pid/sessionid` and `/proc/$pid/loginuid`. Particularly,
both files were set to `4294967295`, the magic value denoting `unset`.

While the manual page says elevators such as sudo should not set the loginuid,
run0 is a bit of a special case: The unit spawned by it is not child of
the running user session, and as such there is no id to inherit.

`systemd` upstream uses `pam_loginuid`, and for consistency we should too.
Especially because it prevents a whole lot of pain when working with `auditd`.

As to pam mounts:
On nixos we enable those if they are globally enabled. Upstream does not.
Considering the password entered into polkit is usually not the user password
of the account which will own the unit, pam mount will fail for any partition
which requires a password. Thus it makes sense to also disable pam mounts
for our run0, it prevents unnecessary unexpected pain.
2025-07-25 23:49:59 +02:00
Wolfgang Walther 90604d95bc
Merge branch 'staging-next' into staging 2025-07-24 14:33:09 +02:00