Merge pull request #6893 from hrdinka/nsd-config-options

nsd: Fix automatic config options

+21 -9
+19 -9
nixos/modules/services/networking/nsd.nix
··· 9 stateDir = "/var/lib/nsd"; 10 pidFile = stateDir + "/var/nsd.pid"; 11 12 zoneFiles = pkgs.stdenv.mkDerivation { 13 preferLocalBuild = true; 14 name = "nsd-env"; ··· 277 default = null; 278 example = "%s"; 279 description = '' 280 - When config.nsd.zoneStats is set to true NSD is able of collecting 281 statistics per zone. All statistics of this zone(s) will be added 282 to the group specified by this given name. Use "%s" to use the zones 283 name as the group. The groups are output from nsd-control stats ··· 297 default = false; 298 description = '' 299 Whether to enable the NSD authoritative domain name server. 300 ''; 301 }; 302 ··· 673 674 config = mkIf cfg.enable { 675 676 - # this is not working :( 677 - nixpkgs.config.nsd = { 678 - ipv6 = cfg.ipv6; 679 - ratelimit = cfg.ratelimit.enable; 680 - rootServer = cfg.rootServer; 681 - }; 682 - 683 users.extraGroups = singleton { 684 name = username; 685 gid = config.ids.gids.nsd; ··· 702 serviceConfig = { 703 PIDFile = pidFile; 704 Restart = "always"; 705 - ExecStart = "${pkgs.nsd}/sbin/nsd -d -c ${configFile}"; 706 }; 707 708 preStart = ''
··· 9 stateDir = "/var/lib/nsd"; 10 pidFile = stateDir + "/var/nsd.pid"; 11 12 + nsdPkg = pkgs.nsd.override { 13 + bind8Stats = cfg.bind8Stats; 14 + ipv6 = cfg.ipv6; 15 + ratelimit = cfg.ratelimit.enable; 16 + rootServer = cfg.rootServer; 17 + zoneStats = length (collect (x: (x.zoneStats or null) != null) cfg.zones) > 0; 18 + }; 19 + 20 zoneFiles = pkgs.stdenv.mkDerivation { 21 preferLocalBuild = true; 22 name = "nsd-env"; ··· 285 default = null; 286 example = "%s"; 287 description = '' 288 + When set to something distinct to null NSD is able to collect 289 statistics per zone. All statistics of this zone(s) will be added 290 to the group specified by this given name. Use "%s" to use the zones 291 name as the group. The groups are output from nsd-control stats ··· 305 default = false; 306 description = '' 307 Whether to enable the NSD authoritative domain name server. 308 + ''; 309 + }; 310 + 311 + bind8Stats = mkOption { 312 + type = types.bool; 313 + default = false; 314 + example = true; 315 + description = '' 316 + Wheter to enable BIND8 like statisics. 317 ''; 318 }; 319 ··· 690 691 config = mkIf cfg.enable { 692 693 users.extraGroups = singleton { 694 name = username; 695 gid = config.ids.gids.nsd; ··· 712 serviceConfig = { 713 PIDFile = pidFile; 714 Restart = "always"; 715 + ExecStart = "${nsdPkg}/sbin/nsd -d -c ${configFile}"; 716 }; 717 718 preStart = ''
+2
pkgs/servers/dns/nsd/default.nix
··· 8 , ratelimit ? false 9 , recvmmsg ? false 10 , rootServer ? false 11 , zoneStats ? false 12 }: 13 ··· 32 ++ edf ratelimit "ratelimit" 33 ++ edf recvmmsg "recvmmsg" 34 ++ edf rootServer "root-server" 35 ++ edf zoneStats "zone-stats" 36 ++ [ "--with-ssl=${openssl}" "--with-libevent=${libevent}" ]; 37
··· 8 , ratelimit ? false 9 , recvmmsg ? false 10 , rootServer ? false 11 + , rrtypes ? false 12 , zoneStats ? false 13 }: 14 ··· 33 ++ edf ratelimit "ratelimit" 34 ++ edf recvmmsg "recvmmsg" 35 ++ edf rootServer "root-server" 36 + ++ edf rrtypes "draft-rrtypes" 37 ++ edf zoneStats "zone-stats" 38 ++ [ "--with-ssl=${openssl}" "--with-libevent=${libevent}" ]; 39