forked from DGNum/infrastructure
modules/dgn-dns: init
Also deploy a DNS server on compute01
This commit is contained in:
parent
fef1e90386
commit
c2616ce4f5
12 changed files with 252 additions and 6 deletions
33
modules/dgn-dns/default.nix
Normal file
33
modules/dgn-dns/default.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
args@{ config, lib, meta, name, sources, ... }:
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
mkEnableOption
|
||||
mkIf;
|
||||
|
||||
dns = import sources."dns.nix";
|
||||
|
||||
cfg = config.dgn-dns;
|
||||
in
|
||||
|
||||
{
|
||||
options.dgn-dns = {
|
||||
enable = mkEnableOption "an authoritative dns service on this server.";
|
||||
};
|
||||
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.nsd = {
|
||||
enable = true;
|
||||
|
||||
interfaces = meta.network.${name}.addresses.public;
|
||||
|
||||
zones = import ./zones (args // { inherit dns; });
|
||||
};
|
||||
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 53 ];
|
||||
allowedUDPPorts = [ 53 ];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue