Skip to content

Commit

Permalink
nixos/unbound: add restart (#41885)
Browse files Browse the repository at this point in the history
  • Loading branch information
volth authored and xeji committed Jun 12, 2018
1 parent dbdad4b commit b25a2c9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions nixos/modules/services/networking/unbound.nix
Expand Up @@ -60,7 +60,7 @@ in
};

interfaces = mkOption {
default = [ "127.0.0.1" "::1" ];
default = [ "127.0.0.1" ] ++ optional config.networking.enableIPv6 "::1";
type = types.listOf types.str;
description = "What addresses the server should listen on.";
};
Expand Down Expand Up @@ -112,8 +112,8 @@ in
mkdir -m 0755 -p ${stateDir}/dev/
cp ${confFile} ${stateDir}/unbound.conf
${optionalString cfg.enableRootTrustAnchor ''
${pkgs.unbound}/bin/unbound-anchor -a ${rootTrustAnchorFile} || echo "Root anchor updated!"
chown unbound ${stateDir} ${rootTrustAnchorFile}
${pkgs.unbound}/bin/unbound-anchor -a ${rootTrustAnchorFile} || echo "Root anchor updated!"
chown unbound ${stateDir} ${rootTrustAnchorFile}
''}
touch ${stateDir}/dev/random
${pkgs.utillinux}/bin/mount --bind -n /dev/urandom ${stateDir}/dev/random
Expand All @@ -126,6 +126,8 @@ in
ProtectSystem = true;
ProtectHome = true;
PrivateDevices = true;
Restart = "always";
RestartSec = "5s";
};
};

Expand Down

0 comments on commit b25a2c9

Please sign in to comment.