nixos/dnscrypt-proxy: simplify module logic related to apparmor
This commit is contained in:
parent
83052ef9db
commit
9325c3a616
|
@ -2,8 +2,6 @@
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
apparmorEnabled = config.security.apparmor.enable;
|
|
||||||
|
|
||||||
cfg = config.services.dnscrypt-proxy;
|
cfg = config.services.dnscrypt-proxy;
|
||||||
|
|
||||||
stateDirectory = "/var/lib/dnscrypt-proxy";
|
stateDirectory = "/var/lib/dnscrypt-proxy";
|
||||||
|
@ -187,12 +185,8 @@ in
|
||||||
documentation = [ "man:dnscrypt-proxy(8)" ];
|
documentation = [ "man:dnscrypt-proxy(8)" ];
|
||||||
|
|
||||||
before = [ "nss-lookup.target" ];
|
before = [ "nss-lookup.target" ];
|
||||||
|
after = [ "network.target" ];
|
||||||
after = [ "network.target" ]
|
requires = [ "dnscrypt-proxy.socket "];
|
||||||
++ optional apparmorEnabled "apparmor.service";
|
|
||||||
|
|
||||||
requires = [ "dnscrypt-proxy.socket "]
|
|
||||||
++ optional apparmorEnabled "apparmor.service";
|
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
NonBlocking = "true";
|
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" ''
|
security.apparmor.profiles = singleton (pkgs.writeText "apparmor-dnscrypt-proxy" ''
|
||||||
${pkgs.dnscrypt-proxy}/bin/dnscrypt-proxy {
|
${pkgs.dnscrypt-proxy}/bin/dnscrypt-proxy {
|
||||||
/dev/null rw,
|
/dev/null rw,
|
||||||
|
|
Loading…
Reference in New Issue