From 1f24d8a00118cee33b17f4246b016afcecdb16c8 Mon Sep 17 00:00:00 2001 From: cdombroski Date: Mon, 29 Apr 2024 23:04:23 -0400 Subject: [PATCH] Add polkit --- systems/smolboi/configuration.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/systems/smolboi/configuration.nix b/systems/smolboi/configuration.nix index edc06d3..c7769b6 100644 --- a/systems/smolboi/configuration.nix +++ b/systems/smolboi/configuration.nix @@ -98,6 +98,25 @@ security = { rtkit.enable = true; + polkit = { + enable = true; + extraConfig = '' + polkit.addRule(function(action, subject) { + if ( + subject.isInGroup("users") + && ( + action.id == "org.freedesktop.login1.reboot" || + action.id == "org.freedesktop.login1.reboot-multiple-sessions" || + action.id == "org.freedesktop.login1.power-off" || + action.id == "org.freedesktop.login1.power-off-multiple-sessions" + ) + ) + { + return polkit.Result.YES; + } + }) + ''; + }; }; users.users.cdombroski = { isNormalUser = true;