Allow kiosk to restart getty@tty1 via scoped polkit rule
Build Dev ISO / build-dev-iso (push) Successful in 4m23s

The RadiantWave app can now apply pending updates by restarting its own
TTY session (plain systemctl, no sudo): getty re-autologins kiosk and
the login shell relaunches cage + app from the new generation.

Also drop the cleanRadiantFiles activation script.
This commit is contained in:
NeilClack
2026-08-23 17:54:01 -05:00
parent 9b0036b4da
commit bd9146e641
+16 -4
View File
@@ -55,6 +55,22 @@ in
} }
]; ];
# Let the kiosk app apply pending updates by restarting its own TTY
# session (re-autologin -> fresh cage + RadiantWave). Scoped to exactly
# one unit and verb; everything else keeps stock (denied) policy.
security.polkit.enable = true;
environment.etc."polkit-1/rules.d/10-kiosk-getty.rules".text = ''
polkit.addRule(function(action, subject) {
if (subject.user !== "kiosk") return null;
if (action.id !== "org.freedesktop.systemd1.manage-units") return null;
var unit = action.lookup("unit");
var verb = action.lookup("verb");
if ((unit === "getty@tty1.service" || unit === "getty@tty1") && verb === "restart") {
return polkit.Result.YES;
}
});
'';
hardware.graphics.enable = true; hardware.graphics.enable = true;
time.timeZone = "America/Chicago"; time.timeZone = "America/Chicago";
@@ -69,10 +85,6 @@ in
operation = "switch"; operation = "switch";
}; };
system.activationScripts.cleanRadiantFiles = ''
rm -rf /home/kiosk/.local/radiantwave/audio
'';
# Virtual machine declaration # Virtual machine declaration
virtualisation.vmVariant = { virtualisation.vmVariant = {
boot.loader.systemd-boot.enable = pkgs.lib.mkForce false; boot.loader.systemd-boot.enable = pkgs.lib.mkForce false;