Skip to content

Commit

Permalink
Merge pull request #124799 from rissson/nixos-unbound-fix-124780
Browse files Browse the repository at this point in the history
nixos/unbound: fix define-tag option
  • Loading branch information
andir committed Jul 21, 2021
2 parents 1e41d06 + 6b12cff commit ef9be92
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion nixos/modules/services/networking/unbound.nix
Expand Up @@ -21,7 +21,15 @@ let
))
else throw (traceSeq v "services.unbound.settings: unexpected type");

confFile = pkgs.writeText "unbound.conf" (concatStringsSep "\n" ((mapAttrsToList (toConf "") cfg.settings) ++ [""]));
confNoServer = concatStringsSep "\n" ((mapAttrsToList (toConf "") (builtins.removeAttrs cfg.settings [ "server" ])) ++ [""]);
confServer = concatStringsSep "\n" (mapAttrsToList (toConf " ") (builtins.removeAttrs cfg.settings.server [ "define-tag" ]));

confFile = pkgs.writeText "unbound.conf" ''
server:
${optionalString (cfg.settings.server.define-tag != "") (toOption " " "define-tag" cfg.settings.server.define-tag)}
${confServer}
${confNoServer}
'';

rootTrustAnchorFile = "${cfg.stateDir}/root.key";

Expand Down Expand Up @@ -170,6 +178,7 @@ in {
# prevent race conditions on system startup when interfaces are not yet
# configured
ip-freebind = mkDefault true;
define-tag = mkDefault "";
};
remote-control = {
control-enable = mkDefault false;
Expand Down

0 comments on commit ef9be92

Please sign in to comment.