diff options
author | Joachim Fasting <joachifm@fastmail.fm> | 2017-03-12 16:20:10 +0100 |
---|---|---|
committer | Joachim Fasting <joachifm@fastmail.fm> | 2017-03-15 01:12:35 +0100 |
commit | 9325c3a61646fb1da6ff7377da23c119523d038a (patch) | |
tree | f9c5a89ddfc14584f46776d080e64874ae703581 /nixos/modules/services/networking/dnscrypt-proxy.nix | |
parent | 83052ef9db71b5f70e65b25e255d61da3eaaa0ac (diff) |
nixos/dnscrypt-proxy: simplify module logic related to apparmor
Diffstat (limited to 'nixos/modules/services/networking/dnscrypt-proxy.nix')
-rw-r--r-- | nixos/modules/services/networking/dnscrypt-proxy.nix | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/nixos/modules/services/networking/dnscrypt-proxy.nix b/nixos/modules/services/networking/dnscrypt-proxy.nix index 66fa5e6dd3c5..37d56f1c3c17 100644 --- a/nixos/modules/services/networking/dnscrypt-proxy.nix +++ b/nixos/modules/services/networking/dnscrypt-proxy.nix @@ -2,8 +2,6 @@ with lib; let - apparmorEnabled = config.security.apparmor.enable; - cfg = config.services.dnscrypt-proxy; stateDirectory = "/var/lib/dnscrypt-proxy"; @@ -187,12 +185,8 @@ in documentation = [ "man:dnscrypt-proxy(8)" ]; before = [ "nss-lookup.target" ]; - - after = [ "network.target" ] - ++ optional apparmorEnabled "apparmor.service"; - - requires = [ "dnscrypt-proxy.socket "] - ++ optional apparmorEnabled "apparmor.service"; + after = [ "network.target" ]; + requires = [ "dnscrypt-proxy.socket "]; serviceConfig = { NonBlocking = "true"; @@ -208,7 +202,9 @@ in }; } - (mkIf apparmorEnabled { + (mkIf config.security.apparmor.enable { + systemd.services.dnscrypt-proxy.after = [ "apparmor.service" ]; + security.apparmor.profiles = singleton (pkgs.writeText "apparmor-dnscrypt-proxy" '' ${pkgs.dnscrypt-proxy}/bin/dnscrypt-proxy { /dev/null rw, |