2024-09-16 10:45:08 +02:00
|
|
|
{
|
|
|
|
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" &&
|
2024-09-30 12:25:35 +02:00
|
|
|
subject.isInGroup("users") &&
|
2024-09-16 10:45:08 +02:00
|
|
|
action.lookup("unit") &&
|
|
|
|
action.lookup("unit").match(/^wg-quick-.*\.service$/)
|
|
|
|
) {
|
|
|
|
return polkit.Result.YES;
|
|
|
|
};
|
|
|
|
});
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|