70 lines
1.3 KiB
Nix
70 lines
1.3 KiB
Nix
{
|
|
inputs,
|
|
constants,
|
|
...
|
|
}:
|
|
|
|
{
|
|
imports = [
|
|
inputs.synix.nixosModules.headplane
|
|
inputs.synix.nixosModules.headscale
|
|
];
|
|
|
|
services.resolved.enable = false;
|
|
networking.resolvconf.enable = false;
|
|
|
|
networking.nameservers = [ constants.hosts.sid.ip ];
|
|
|
|
services.coredns = {
|
|
enable = true;
|
|
config = with constants; ''
|
|
.:53 {
|
|
bind ${hosts.sid.ip}
|
|
hosts {
|
|
${hosts.sid.ip} sid.tail
|
|
${hosts.sid.ip} netdata.sid.tail
|
|
${hosts.rx4.ip} rx4.tail
|
|
${hosts.rx4.ip} dav.rx4.tail
|
|
${hosts.rx4.ip} pw.rx4.tail
|
|
${hosts.vde.ip} vde.tail
|
|
fallthrough
|
|
}
|
|
forward . 1.1.1.1
|
|
cache
|
|
log
|
|
errors
|
|
}
|
|
'';
|
|
};
|
|
|
|
services.headplane = {
|
|
enable = true;
|
|
reverseProxy = {
|
|
enable = true;
|
|
subdomain = "hp";
|
|
};
|
|
};
|
|
|
|
services.headscale = {
|
|
enable = true;
|
|
openFirewall = true;
|
|
reverseProxy = {
|
|
enable = true;
|
|
subdomain = "hs";
|
|
};
|
|
settings = {
|
|
dns = {
|
|
magic_dns = true;
|
|
base_domain = "tail";
|
|
search_domains = [ "tail" ];
|
|
override_local_dns = true;
|
|
nameservers = {
|
|
global = [ "1.1.1.1" ];
|
|
split = {
|
|
"tail" = [ constants.hosts.sid.ip ];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|