summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorLeo <git@em0lar.de>2021-07-17 08:03:20 +0200
committerGitHub <noreply@github.com>2021-07-17 08:03:20 +0200
commitbb568917b2c8dfc058d534cc4cc0d1e5588b7664 (patch)
tree5aed609f1e6b15d48c7b547987c2b1d7ed8419fe /nixos
parent7914c1284c4ebe252f566a9c5d04b38673719087 (diff)
downloadnixpkgs-bb568917b2c8dfc058d534cc4cc0d1e5588b7664.tar
nixpkgs-bb568917b2c8dfc058d534cc4cc0d1e5588b7664.tar.gz
nixpkgs-bb568917b2c8dfc058d534cc4cc0d1e5588b7664.tar.bz2
nixpkgs-bb568917b2c8dfc058d534cc4cc0d1e5588b7664.tar.lz
nixpkgs-bb568917b2c8dfc058d534cc4cc0d1e5588b7664.tar.xz
nixpkgs-bb568917b2c8dfc058d534cc4cc0d1e5588b7664.tar.zst
nixpkgs-bb568917b2c8dfc058d534cc4cc0d1e5588b7664.zip
nixos/bind: add directory config option (#129188)
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/networking/bind.nix11
1 files changed, 10 insertions, 1 deletions
diff --git a/nixos/modules/services/networking/bind.nix b/nixos/modules/services/networking/bind.nix
index 33da4071638..480d5a184f2 100644
--- a/nixos/modules/services/networking/bind.nix
+++ b/nixos/modules/services/networking/bind.nix
@@ -61,7 +61,7 @@ let
         blackhole { badnetworks; };
         forward first;
         forwarders { ${concatMapStrings (entry: " ${entry}; ") cfg.forwarders} };
-        directory "/run/named";
+        directory "${cfg.directory}";
         pid-file "/run/named/named.pid";
         ${cfg.extraOptions}
       };
@@ -166,6 +166,12 @@ in
         ";
       };
 
+      directory = mkOption {
+        type = types.str;
+        default = "/run/named";
+        description = "Working directory of BIND.";
+      };
+
       zones = mkOption {
         default = [ ];
         type = with types; coercedTo (listOf attrs) bindZoneCoerce (attrsOf (types.submodule bindZoneOptions));
@@ -240,6 +246,9 @@ in
 
         ${pkgs.coreutils}/bin/mkdir -p /run/named
         chown ${bindUser} /run/named
+
+        ${pkgs.coreutils}/bin/mkdir -p ${cfg.directory}
+        chown ${bindUser} ${cfg.directory}
       '';
 
       serviceConfig = {