nixos/polkit/network: create and allow to manage wireguard client services
This commit is contained in:
parent
d543c41694
commit
72f3d20210
1 changed files with 16 additions and 0 deletions
16
nix-os/polkit/network.nix
Normal file
16
nix-os/polkit/network.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
config = {
|
||||
security.polkit.extraConfig = ''
|
||||
polkit.addRule(function(action, subject) {
|
||||
// Allow to start and stop wireguard client services
|
||||
if (
|
||||
action.id == "org.freedesktop.systemd1.manage-units" &&
|
||||
action.lookup("unit") &&
|
||||
action.lookup("unit").match(/^wg-quick-.*\.service$/)
|
||||
) {
|
||||
return polkit.Result.YES;
|
||||
};
|
||||
});
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue