···9 stateDir = "/var/lib/nsd";
10 pidFile = stateDir + "/var/nsd.pid";
110000000012 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.
000000000300 '';
301 };
302···673674 config = mkIf cfg.enable {
675676- # 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 };
707708 preStart = ''
···9 stateDir = "/var/lib/nsd";
10 pidFile = stateDir + "/var/nsd.pid";
1112+ 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···690691 config = mkIf cfg.enable {
6920000000693 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 };
717718 preStart = ''