nixpkgs/nixos/modules/system/boot/systemd
phaer dd88db29ed modules/systemd-oomd: add After=systemd-sysusers.service
Before this change, systemd-oomd startup was flaky at least with
either systemd-sysusers or userborn enabled. It would restart several
times until users were provisioned, so that it finally succeeded.

An alternative would be to use a DynamicUser which was my first
approach, before I discovered that upstream added the after statement
in Dec 2024[1]. DynamicUsers could have further
implications (sandboxing, etc), so we follow upstream here.

It's not clear to me we why Upstreams "After=systemd-sysusers.service"
doesn't show up on nixos-unstable systems (systemd v257.6).

Userborn is covered, as its unit is aliased to systemd-sysusers.service.

The following test succeeded after this change on x86_64-linux:

  nix-build -A nixosTests.systemd-oomd

[1]: 36dd429680
2025-07-11 15:13:25 +02:00
..
coredump.nix
dm-verity.nix
fido2.nix
homed.nix
initrd-secrets.nix
initrd.nix nixos/systemd-initrd: Fix fsck.xfs failing due to missing sh 2025-06-28 14:50:51 +01:00
journald-gateway.nix
journald-remote.nix
journald-upload.nix
journald.nix nixos/systemd: unconditional systemd-journald-audit.socket 2025-05-18 19:58:59 +00:00
logind.nix
nspawn.nix
oomd.nix modules/systemd-oomd: add After=systemd-sysusers.service 2025-07-11 15:13:25 +02:00
repart.nix repart: Enable discard option 2025-04-11 12:46:50 +02:00
shutdown.nix nixos/shutdown: Create /run/initramfs with mode 0700 2025-04-13 12:02:16 -04:00
sysupdate.nix
sysusers.nix nixos/sysusers: respect per user .enable 2025-03-20 20:43:00 +00:00
tmpfiles.nix nixos/tmpfiles: properly escape argument option 2025-04-02 13:23:42 +02:00
tpm2.nix
user.nix
userdbd.nix