mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2026-05-28 17:21:12 +02:00
base/polkit: let wheel users use AUTH_KEEP_SELF for systemd actions
This commit is contained in:
@@ -6,9 +6,12 @@ in
|
|||||||
security.polkit.enable = true;
|
security.polkit.enable = true;
|
||||||
|
|
||||||
environment.etc."polkit-1/rules.d/9-nixos-overrides.rules".text = lib.mkIf cfg.enable ''
|
environment.etc."polkit-1/rules.d/9-nixos-overrides.rules".text = lib.mkIf cfg.enable ''
|
||||||
polkit.addAdminRule(function(action, subject) {
|
polkit.addRule(function(action, subject) {
|
||||||
if(subject.isInGroup("wheel")) {
|
if (
|
||||||
return ["unix-user:"+subject.user];
|
action.id.startsWith("org.freedesktop.systemd1.") &&
|
||||||
|
subject.isInGroup("wheel")
|
||||||
|
) {
|
||||||
|
return polkit.Result.AUTH_SELF_KEEP;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
'';
|
'';
|
||||||
|
|||||||
Reference in New Issue
Block a user