From fb185edafbd59ec7f564080f1716ef16f47a9428 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Sat, 9 Sep 2023 11:58:42 +0200 Subject: [PATCH] will the nuclear option work? --- profiles/no-suspend.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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; + } + }); + ''; + }