55 lines
992 B
Nix
55 lines
992 B
Nix
{ config, ... }:
|
|
{
|
|
services.coredns = {
|
|
enable = true;
|
|
|
|
extraArgs = [ "-quiet" ];
|
|
|
|
config = ''
|
|
.:5454 {
|
|
bind lo
|
|
reload 5s
|
|
file /etc/coredns/tailscale.zone datarift.nl {
|
|
reload 10s
|
|
}
|
|
forward . 127.0.0.1:5335
|
|
log
|
|
debug
|
|
errors
|
|
}
|
|
|
|
.:5455 {
|
|
bind lo
|
|
reload 5s
|
|
file /etc/coredns/datarift.zone datarift.nl {
|
|
reload 10s
|
|
}
|
|
forward . 127.0.0.1:5335
|
|
log
|
|
debug
|
|
errors
|
|
}
|
|
'';
|
|
};
|
|
|
|
environment.etc = {
|
|
"coredns/datarift.zone" = {
|
|
source = ./datarift.zone;
|
|
mode = "0644";
|
|
};
|
|
"coredns/tailscale.zone" = {
|
|
source = ./tailscale.zone;
|
|
mode = "0644";
|
|
};
|
|
};
|
|
|
|
systemd.services.coredns = {
|
|
environment = {
|
|
HOME = "%S/coredns";
|
|
};
|
|
serviceConfig = {
|
|
StateDirectory = "coredns";
|
|
EnvironmentFile = [ config.sops.secrets.coredns-env.path ];
|
|
};
|
|
};
|
|
}
|