nixos/bind: add extraArgs option for command-line arguments (#442322)

kirillrdy 6caa2d12 92127274

Changed files
+13 -1
nixos
modules
services
networking
+13 -1
nixos/modules/services/networking/bind.nix
···
'';
};
+
extraArgs = lib.mkOption {
+
type = lib.types.listOf lib.types.str;
+
default = [ ];
+
description = ''
+
Additional command-line arguments to pass to named.
+
'';
+
example = [
+
"-n"
+
"4"
+
];
+
};
+
configFile = lib.mkOption {
type = lib.types.path;
default = confFile;
···
serviceConfig = {
Type = "forking"; # Set type to forking, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=900788
-
ExecStart = "${bindPkg.out}/sbin/named ${lib.optionalString cfg.ipv4Only "-4"} -c ${cfg.configFile}";
+
ExecStart = "${bindPkg.out}/sbin/named ${lib.optionalString cfg.ipv4Only "-4"} -c ${cfg.configFile} ${lib.concatStringsSep " " cfg.extraArgs}";
ExecReload = "${bindPkg.out}/sbin/rndc -k '/etc/bind/rndc.key' reload";
ExecStop = "${bindPkg.out}/sbin/rndc -k '/etc/bind/rndc.key' stop";
User = bindUser;