athens/nix/modules/coredns/default.nix

46 lines
842 B
Nix
Raw Normal View History

2022-12-27 10:10:53 -05:00
{ config, lib, ... }:
2021-07-09 22:59:33 -04:00
with lib;
2021-07-09 22:59:33 -04:00
let cfg = config.walkah.coredns;
2022-05-06 20:01:04 -04:00
in
{
2021-07-09 22:59:33 -04:00
options.walkah.coredns = {
enable = mkEnableOption "";
addr = mkOption {
type = types.str;
default = "0.0.0.0";
example = "192.168.6.1";
};
};
config = mkIf cfg.enable {
services.coredns = {
enable = true;
config = ''
. {
bind 127.0.0.1
2021-07-09 22:59:33 -04:00
bind ${cfg.addr}
prometheus ${cfg.addr}:9153
log
errors
cache
dnssec
forward . tls://1.1.1.1 tls://1.0.0.1 {
tls_servername cloudflare-dns.com
}
}
walkah.lab {
bind ${cfg.addr}
file ${./walkah.lab.zone}
}
2021-07-09 22:59:33 -04:00
'';
};
networking = {
nameservers = [ "127.0.0.1" ];
search = [ "walkah.lab" ];
};
};
}