nixpkgs/nixos/modules/system
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
..
activation nixos/activatable-script: drop nettools dependency 2025-07-06 00:59:35 +02:00
boot modules/systemd-oomd: add After=systemd-sysusers.service 2025-07-11 15:13:25 +02:00
etc system.etc.overlay: build erofs also locally 2025-05-30 18:52:30 +02:00
build.nix treewide: format all inactive Nix files 2024-12-10 20:26:33 +01:00