nixos-config/lib/instantiate-zone.nix

19 lines
525 B
Nix

{ config, lib, pkgs, ... }:
with lib;
let
mkSrvRecord = host: port: { inherit host port; };
instantiateZone = zoneName:
{ primaryNameserver, secondaryNameservers ? [ ], externalNameservers ? [ ]
, smtpServers, imapServers, ... }: {
gssapi-realm = gssapiRealm;
mx = smtpServers;
dmarc-report-address = "dmarc-report@${zoneName}";
default-host = defaultHost;
verbatim-dns-records =
mkIf (ksk != null) [ ksk.public-key-record ksk.ds ];
};
in { inherit instantiateZone; }