From 33d7819619bffbfd382a487e7481ab64181ff7f3 Mon Sep 17 00:00:00 2001 From: colin Date: Wed, 25 Jan 2023 08:18:29 +0000 Subject: [PATCH] trust-dns: add a "quiet" option and enable it --- hosts/by-name/servo/services/trust-dns.nix | 1 + modules/services/trust-dns.nix | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/hosts/by-name/servo/services/trust-dns.nix b/hosts/by-name/servo/services/trust-dns.nix index e6c472d4..17521ca8 100644 --- a/hosts/by-name/servo/services/trust-dns.nix +++ b/hosts/by-name/servo/services/trust-dns.nix @@ -9,6 +9,7 @@ "192.168.0.5" "10.0.1.5" ]; + sane.services.trust-dns.quiet = true; sane.services.trust-dns.zones."uninsane.org".TTL = 900; diff --git a/modules/services/trust-dns.nix b/modules/services/trust-dns.nix index b8d8db82..8212ec65 100644 --- a/modules/services/trust-dns.nix +++ b/modules/services/trust-dns.nix @@ -72,6 +72,10 @@ in default = []; description = "array of ipv4 addresses on which to listen for DNS queries"; }; + quiet = mkOption { + type = types.bool; + default = false; + }; # reference zones = mkOption { type = types.attrsOf (types.submodule { @@ -160,11 +164,14 @@ in systemd.services.trust-dns = { description = "trust-dns DNS server"; serviceConfig = { - ExecStart = '' - ${pkgs.trust-dns}/bin/named \ - --config ${configFile} \ - --zonedir / - ''; + ExecStart = + let + flags = lib.optionalString cfg.quiet "-q"; + in '' + ${pkgs.trust-dns}/bin/named \ + --config ${configFile} \ + --zonedir / ${flags} + ''; Type = "simple"; Restart = "on-failure"; RestartSec = "10s";