config/profiles/no-suspend.nix

23 lines
707 B
Nix
Raw Normal View History

2023-07-02 09:19:35 +02:00
{
systemd.targets.sleep.enable = false;
systemd.targets.suspend.enable = false;
systemd.targets.hibernate.enable = false;
systemd.targets.hybrid-sleep.enable = false;
2023-07-04 16:32:09 +02:00
2023-07-05 00:40:34 +02:00
services.xserver.displayManager.gdm.autoSuspend = false;
2023-09-09 11:58:42 +02:00
security.polkit.enable = true;
security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.login1.suspend" ||
action.id == "org.freedesktop.login1.suspend-multiple-sessions" ||
action.id == "org.freedesktop.login1.hibernate" ||
action.id == "org.freedesktop.login1.hibernate-multiple-sessions")
{
return polkit.Result.NO;
}
});
'';
2023-07-02 09:19:35 +02:00
}