about summary refs log tree commit diff
path: root/nixos/modules/services/networking
diff options
context:
space:
mode:
authorvolth <volth@webmaster.ms>2018-06-12 12:29:25 +0000
committerxeji <36407913+xeji@users.noreply.github.com>2018-06-12 14:29:25 +0200
commitb25a2c961466c152f27830022c4d4e645d5e5584 (patch)
tree539cec976102e0fd3f0ea3a719f878eb71a0cd5e /nixos/modules/services/networking
parentdbdad4b44ba9866223a402d3df5969519d2366ab (diff)
downloadnixlib-b25a2c961466c152f27830022c4d4e645d5e5584.tar
nixlib-b25a2c961466c152f27830022c4d4e645d5e5584.tar.gz
nixlib-b25a2c961466c152f27830022c4d4e645d5e5584.tar.bz2
nixlib-b25a2c961466c152f27830022c4d4e645d5e5584.tar.lz
nixlib-b25a2c961466c152f27830022c4d4e645d5e5584.tar.xz
nixlib-b25a2c961466c152f27830022c4d4e645d5e5584.tar.zst
nixlib-b25a2c961466c152f27830022c4d4e645d5e5584.zip
nixos/unbound: add restart (#41885)
Diffstat (limited to 'nixos/modules/services/networking')
-rw-r--r--nixos/modules/services/networking/unbound.nix8
1 files changed, 5 insertions, 3 deletions
diff --git a/nixos/modules/services/networking/unbound.nix b/nixos/modules/services/networking/unbound.nix
index f069a9883a7f..07936faaa133 100644
--- a/nixos/modules/services/networking/unbound.nix
+++ b/nixos/modules/services/networking/unbound.nix
@@ -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.";
       };
@@ -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
@@ -126,6 +126,8 @@ in
         ProtectSystem = true;
         ProtectHome = true;
         PrivateDevices = true;
+        Restart = "always";
+        RestartSec = "5s";
       };
     };