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 9 stateDir = "/var/lib/nsd"; 10 10 pidFile = stateDir + "/var/nsd.pid"; 11 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 + 12 20 zoneFiles = pkgs.stdenv.mkDerivation { 13 21 preferLocalBuild = true; 14 22 name = "nsd-env"; ··· 277 285 default = null; 278 286 example = "%s"; 279 287 description = '' 280 - When config.nsd.zoneStats is set to true NSD is able of collecting 288 + When set to something distinct to null NSD is able to collect 281 289 statistics per zone. All statistics of this zone(s) will be added 282 290 to the group specified by this given name. Use "%s" to use the zones 283 291 name as the group. The groups are output from nsd-control stats ··· 297 305 default = false; 298 306 description = '' 299 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. 300 317 ''; 301 318 }; 302 319 ··· 673 690 674 691 config = mkIf cfg.enable { 675 692 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 693 users.extraGroups = singleton { 684 694 name = username; 685 695 gid = config.ids.gids.nsd; ··· 702 712 serviceConfig = { 703 713 PIDFile = pidFile; 704 714 Restart = "always"; 705 - ExecStart = "${pkgs.nsd}/sbin/nsd -d -c ${configFile}"; 715 + ExecStart = "${nsdPkg}/sbin/nsd -d -c ${configFile}"; 706 716 }; 707 717 708 718 preStart = ''
+2
pkgs/servers/dns/nsd/default.nix
··· 8 8 , ratelimit ? false 9 9 , recvmmsg ? false 10 10 , rootServer ? false 11 + , rrtypes ? false 11 12 , zoneStats ? false 12 13 }: 13 14 ··· 32 33 ++ edf ratelimit "ratelimit" 33 34 ++ edf recvmmsg "recvmmsg" 34 35 ++ edf rootServer "root-server" 36 + ++ edf rrtypes "draft-rrtypes" 35 37 ++ edf zoneStats "zone-stats" 36 38 ++ [ "--with-ssl=${openssl}" "--with-libevent=${libevent}" ]; 37 39