2023-01-17 22:56:05 +00:00
|
|
|
{ lib, pkgs, config, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.skynet_dns;
|
|
|
|
in {
|
|
|
|
options = {
|
|
|
|
skynet_dns = {
|
|
|
|
enable = lib.mkEnableOption {
|
|
|
|
default = false;
|
|
|
|
example = true;
|
|
|
|
description = "Skynet DNS";
|
|
|
|
type = lib.types.bool;
|
2023-01-17 22:40:04 +00:00
|
|
|
};
|
2023-01-17 22:56:05 +00:00
|
|
|
|
|
|
|
records = {
|
|
|
|
external = lib.mkOption {
|
|
|
|
default = [ ];
|
|
|
|
type = lib.types.listOf lib.types.str;
|
|
|
|
description = ''
|
|
|
|
External records like: agentjones A 193.1.99.72
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
cname = lib.mkOption {
|
|
|
|
default = [ ];
|
|
|
|
type = lib.types.listOf lib.types.str;
|
|
|
|
description = ''
|
|
|
|
External records like: ns1 CNAME ns1
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
2023-01-17 22:40:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2023-01-17 22:56:05 +00:00
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
services.bind = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
forwarders = [
|
|
|
|
# these were in old config file
|
|
|
|
"193.1.100.130"
|
|
|
|
"193.1.100.131"
|
|
|
|
];
|
|
|
|
|
2023-01-17 23:02:12 +00:00
|
|
|
/*
|
|
|
|
put any other zones above skynet and link to their files like so:
|
|
|
|
|
|
|
|
skynet.ie = {
|
|
|
|
extraConfig = "";
|
|
|
|
file = ./dns/skynet;
|
|
|
|
master = true;
|
|
|
|
masters = [];
|
|
|
|
slaves = [ ];
|
|
|
|
};
|
|
|
|
|
|
|
|
Skynet is handled a bit more dynamically since it is the key one we should focus on
|
|
|
|
*/
|
|
|
|
|
2023-01-17 22:56:05 +00:00
|
|
|
skynet.ie = {
|
|
|
|
extraConfig = "";
|
|
|
|
file = ./dns/skynet;
|
|
|
|
master = true;
|
|
|
|
masters = [];
|
|
|
|
slaves = [ ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2023-01-17 22:40:04 +00:00
|
|
|
|
|
|
|
}
|