[Backport release-25.05] nixos/systemd: fix run0 failing to run commands (#429202)

This commit is contained in:
Will Fancher
2025-07-29 23:33:42 -04:00
committed by GitHub

View File

@@ -831,6 +831,15 @@ in
minsize = "1M";
};
};
# run0 is supposed to authenticate the user via polkit and then run a command. Without this next
# part, run0 would fail to run the command even if authentication is successful and the user has
# permission to run the command. This next part is only enabled if polkit is enabled because the
# error that were trying to avoid cant possibly happen if polkit isnt enabled. When polkit isnt
# enabled, run0 will fail before it even tries to run the command.
security.pam.services = mkIf config.security.polkit.enable {
systemd-run0 = { };
};
};
# FIXME: Remove these eventually.