modules/desktop: add polkit rules for pkexec use
This commit is contained in:
parent
5d0200a141
commit
dce1e071fc
2 changed files with 17 additions and 0 deletions
|
@ -11,6 +11,7 @@ in {
|
|||
./helix-desktop.nix
|
||||
./open-in-blackbox.nix
|
||||
./bluetooth.nix
|
||||
./pkexec.nix
|
||||
];
|
||||
|
||||
services.xserver = {
|
||||
|
|
16
modules/desktop/pkexec.nix
Normal file
16
modules/desktop/pkexec.nix
Normal 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;
|
||||
}
|
||||
}
|
||||
});
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue