nixos/bind: add directory config option (#129188)

This commit is contained in:
Leo 2021-07-17 08:03:20 +02:00 committed by GitHub
parent 7914c1284c
commit bb568917b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -61,7 +61,7 @@ let
blackhole { badnetworks; }; blackhole { badnetworks; };
forward first; forward first;
forwarders { ${concatMapStrings (entry: " ${entry}; ") cfg.forwarders} }; forwarders { ${concatMapStrings (entry: " ${entry}; ") cfg.forwarders} };
directory "/run/named"; directory "${cfg.directory}";
pid-file "/run/named/named.pid"; pid-file "/run/named/named.pid";
${cfg.extraOptions} ${cfg.extraOptions}
}; };
@ -166,6 +166,12 @@ in
"; ";
}; };
directory = mkOption {
type = types.str;
default = "/run/named";
description = "Working directory of BIND.";
};
zones = mkOption { zones = mkOption {
default = [ ]; default = [ ];
type = with types; coercedTo (listOf attrs) bindZoneCoerce (attrsOf (types.submodule bindZoneOptions)); type = with types; coercedTo (listOf attrs) bindZoneCoerce (attrsOf (types.submodule bindZoneOptions));
@ -240,6 +246,9 @@ in
${pkgs.coreutils}/bin/mkdir -p /run/named ${pkgs.coreutils}/bin/mkdir -p /run/named
chown ${bindUser} /run/named chown ${bindUser} /run/named
${pkgs.coreutils}/bin/mkdir -p ${cfg.directory}
chown ${bindUser} ${cfg.directory}
''; '';
serviceConfig = { serviceConfig = {