diff --git a/profiles/no-suspend.nix b/profiles/no-suspend.nix index 59b9c5f..2f861e5 100644 --- a/profiles/no-suspend.nix +++ b/profiles/no-suspend.nix @@ -5,4 +5,18 @@ systemd.targets.hybrid-sleep.enable = false; services.xserver.displayManager.gdm.autoSuspend = false; + + 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; + } + }); + ''; + }