summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorArnold Krille <arnold@arnoldarts.de>2016-05-21 13:12:48 +0200
committerFranz Pletz <fpletz@fnordicwalking.de>2016-05-21 22:27:27 +0200
commitbf0e745597c5fc9547e41905f0f0354d009f154e (patch)
treea7ec510e8ac60ff0afa44953645836c7607f9e4e /nixos
parentd5656873d7b0d5bc52794b3d2c403835426ebd5e (diff)
downloadnixlib-bf0e745597c5fc9547e41905f0f0354d009f154e.tar
nixlib-bf0e745597c5fc9547e41905f0f0354d009f154e.tar.gz
nixlib-bf0e745597c5fc9547e41905f0f0354d009f154e.tar.bz2
nixlib-bf0e745597c5fc9547e41905f0f0354d009f154e.tar.lz
nixlib-bf0e745597c5fc9547e41905f0f0354d009f154e.tar.xz
nixlib-bf0e745597c5fc9547e41905f0f0354d009f154e.tar.zst
nixlib-bf0e745597c5fc9547e41905f0f0354d009f154e.zip
unbound service: do not initialize root cert
When enableRootTrustAnchor is set to false, there is really no point in
initializing the root key before starting unbound.

Fixes #15605.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/networking/unbound.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/nixos/modules/services/networking/unbound.nix b/nixos/modules/services/networking/unbound.nix
index 89762fe52488..0dd24478f409 100644
--- a/nixos/modules/services/networking/unbound.nix
+++ b/nixos/modules/services/networking/unbound.nix
@@ -106,8 +106,10 @@ in
       preStart = ''
         mkdir -m 0755 -p ${stateDir}/dev/
         cp ${confFile} ${stateDir}/unbound.conf
+        ${optionalString cfg.enableRootTrustAnchor ''
         ${pkgs.unbound}/bin/unbound-anchor -a ${rootTrustAnchorFile}
         chown unbound ${stateDir} ${rootTrustAnchorFile}
+        ''}
         touch ${stateDir}/dev/random
         ${pkgs.utillinux}/bin/mount --bind -n /dev/random ${stateDir}/dev/random
       '';