trust-dns: add a "quiet" option and enable it

This commit is contained in:
colin 2023-01-25 08:18:29 +00:00
parent 0846abb6bf
commit 33d7819619
2 changed files with 13 additions and 5 deletions

View File

@ -9,6 +9,7 @@
"192.168.0.5" "192.168.0.5"
"10.0.1.5" "10.0.1.5"
]; ];
sane.services.trust-dns.quiet = true;
sane.services.trust-dns.zones."uninsane.org".TTL = 900; sane.services.trust-dns.zones."uninsane.org".TTL = 900;

View File

@ -72,6 +72,10 @@ in
default = []; default = [];
description = "array of ipv4 addresses on which to listen for DNS queries"; description = "array of ipv4 addresses on which to listen for DNS queries";
}; };
quiet = mkOption {
type = types.bool;
default = false;
};
# reference <nixpkgs:nixos/modules/services/web-servers/nginx/vhost-options.nix> # reference <nixpkgs:nixos/modules/services/web-servers/nginx/vhost-options.nix>
zones = mkOption { zones = mkOption {
type = types.attrsOf (types.submodule { type = types.attrsOf (types.submodule {
@ -160,10 +164,13 @@ in
systemd.services.trust-dns = { systemd.services.trust-dns = {
description = "trust-dns DNS server"; description = "trust-dns DNS server";
serviceConfig = { serviceConfig = {
ExecStart = '' ExecStart =
let
flags = lib.optionalString cfg.quiet "-q";
in ''
${pkgs.trust-dns}/bin/named \ ${pkgs.trust-dns}/bin/named \
--config ${configFile} \ --config ${configFile} \
--zonedir / --zonedir / ${flags}
''; '';
Type = "simple"; Type = "simple";
Restart = "on-failure"; Restart = "on-failure";