systemd: fix rescue/emergency targets to allow root login

This commit is contained in:
2025-05-30 00:22:27 +00:00
parent 2aa2af823d
commit 82096288e2

View File

@@ -130,6 +130,11 @@ in
DefaultTimeoutStopSec=${builtins.toString haltTimeout}
'';
# fixes "Cannot open access to console, the root account is locked" on systemd init failure.
# see: <https://github.com/systemd/systemd/commit/33eb44fe4a8d7971b5614bc4c2d90f8d91cce66c>
systemd.services.emergency.environment.SYSTEMD_SULOGIN_FORCE = "1";
systemd.services.rescue.environment.SYSTEMD_SULOGIN_FORCE = "1";
# harden base systemd services
# see: `systemd-analyze security`
systemd.services.systemd-rfkill.serviceConfig = {