summaryrefslogtreecommitdiff
path: root/config/dns.nix
diff options
context:
space:
mode:
authorKjetil Orbekk <kjetil.orbekk@gmail.com>2017-05-21 09:26:14 -0400
committerKjetil Orbekk <kjetil.orbekk@gmail.com>2017-05-21 09:26:14 -0400
commit8b70470ee557dd61a6b4af1438ac542531c9b60e (patch)
treeafeb1632f95dae5e339a77c2886ec2acd7ee3e8a /config/dns.nix
parent8b9df2c8fc8262c6f56a90745b06390381b33fc0 (diff)
dns: Add remaining zones
Diffstat (limited to 'config/dns.nix')
-rw-r--r--config/dns.nix23
1 files changed, 13 insertions, 10 deletions
diff --git a/config/dns.nix b/config/dns.nix
index 9f05807..a7de636 100644
--- a/config/dns.nix
+++ b/config/dns.nix
@@ -1,26 +1,29 @@
# dnssec-signzone -A -3 $(head -c 1000 /dev/urandom | sha1sum | cut -b 1-16) -N unixtime -o $zone -t db.${zone}
{ config, lib, pkgs, ... }:
let
- zones = pkgs.callPackage ../pkgs/zone-files/default.nix { };
+ masterZones = [ "orbekk.com" "orbekk.no" "kufieta.net" ];
+ zone-files = pkgs.callPackage ../pkgs/zone-files/default.nix { };
in
{
services.bind = {
enable = true;
extraConfig = ''
- zone orbekk.com {
- type master;
- file "/var/run/named/db.orbekk.com.zone";
- auto-dnssec maintain;
- key-directory "/opt/secret/bind/orbekk.com";
- update-policy local;
- allow-query { any; };
- };
+ ${concatMapStrings (zone: ''
+ zone orbekk.com {
+ type master;
+ file "/var/run/named/db.${zone}.zone";
+ auto-dnssec maintain;
+ key-directory "/opt/secret/bind/${zone}";
+ update-policy local;
+ allow-query { any; };
+ };
+ '') masterZones}
'';
};
systemd.services.bind = {
preStart = lib.mkAfter ''
- cp -f ${zones}/* /var/run/named/
+ cp -f ${zone-files}/* /var/run/named/
'';
};
}