17 lines
424 B
Nix
17 lines
424 B
Nix
|
{
|
||
|
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;
|
||
|
};
|
||
|
});
|
||
|
'';
|
||
|
};
|
||
|
}
|