Skip to content

Commit

Permalink
nixos/dnscrypt-wrapper: fix rotate script failing to restart the service
Browse files Browse the repository at this point in the history
(cherry picked from commit c883311)
  • Loading branch information
rnhmjoj authored and joachifm committed Jan 15, 2018
1 parent 74286ec commit fea2430
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions nixos/modules/services/networking/dnscrypt-wrapper.nix
Expand Up @@ -145,6 +145,16 @@ in {
};
users.groups.dnscrypt-wrapper = { };

security.polkit.extraConfig = ''
// Allow dnscrypt-wrapper user to restart dnscrypt-wrapper.service
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.systemd1.manage-units" &&
action.lookup("unit") == "dnscrypt-wrapper.service" &&
subject.user == "dnscrypt-wrapper") {
return polkit.Result.YES;
}
});
'';

systemd.services.dnscrypt-wrapper = {
description = "dnscrypt-wrapper daemon";
Expand Down

0 comments on commit fea2430

Please sign in to comment.