nix-conf/modules/system/dns/default.nix

37 lines
815 B
Nix
Raw Normal View History

2023-03-06 13:52:34 +01:00
{ options, config, pkgs, lib, ... }:
with lib;
#with lib.internal;
2023-03-06 21:46:14 +01:00
let
cfg = config.custom.system.dns;
zones = {
"geek" = import ./geek.nix pkgs;
"glue" = import ./glue.nix pkgs;
};
2023-03-06 13:52:34 +01:00
in
{
options.custom.system.dns = with types; {
enable = mkBoolOpt false "Whether or not to enable creation of dns server.";
};
config = mkIf cfg.enable {
services.bind = {
enable = true;
2023-03-06 13:53:14 +01:00
forwarders = [];
2023-03-06 15:02:23 +01:00
zones = {
"geek" = {
master = false;
masters = [ "202.83.95.229" ];
2023-03-06 21:48:37 +01:00
file = "${pkgs.opennic-dns-root-data}/geek.zone";
2023-03-06 15:02:23 +01:00
};
2023-03-06 16:09:32 +01:00
"glue" = {
master = false;
masters = [ "195.201.99.61" "168.119.153.26" ];
2023-03-06 21:48:37 +01:00
file = "${pkgs.opennic-dns-root-data}/glue.zone";
2023-03-06 16:09:32 +01:00
};
2023-03-06 15:01:15 +01:00
};
};
2023-03-06 13:52:34 +01:00
};
}