modules/desktop: add polkit rules for pkexec use

This commit is contained in:
Max Headroom 2023-12-03 02:35:44 +01:00
parent 5d0200a141
commit dce1e071fc
2 changed files with 17 additions and 0 deletions

View file

@ -11,6 +11,7 @@ in {
./helix-desktop.nix
./open-in-blackbox.nix
./bluetooth.nix
./pkexec.nix
];
services.xserver = {

View file

@ -0,0 +1,16 @@
{
security.polkit.extraConfig = /*javascript*/ ''
polkit.addRule(function(action, subject) {
if (
action.id == "org.freedesktop.policykit.exec" &&
subject.isInGroup("wheel")
) {
if (subject.active) {
return polkit.Result.AUTH_SELF_KEEP;
} else {
return polkit.Result.AUTH_SELF;
}
}
});
'';
}