Headscale is the tailnet control server every host's services/tailscale.nix already points at (--login-server=https://vpn.mgaction.town). MagicDNS base_domain "hosts.mgaction.town" matches the "jupiter.hosts.mgaction.town" names already used in this repo's Caddy vhosts. Headplane is its web UI, running as headscale's own user (native process integration, no container). No OIDC wired up - log in with a headscale API key generated on the box. Both proxied through Caddy; headscale's vhost needs flush_interval -1 since its node-update endpoint is a long-poll. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
29 lines
974 B
Nix
29 lines
974 B
Nix
{ ... }:
|
|
|
|
# Headscale — self-hosted control server for the tailnet. Every host's
|
|
# services/tailscale.nix points --login-server at https://vpn.mgaction.town
|
|
# (this host). MagicDNS base_domain "hosts.mgaction.town" matches the
|
|
# "jupiter.hosts.mgaction.town" style names already used throughout this
|
|
# repo's Caddy vhosts (e.g. hosts/neptun/configuration.nix) — don't change
|
|
# one without the other.
|
|
#
|
|
# TLS terminates at Caddy (see the host's configuration.nix for the vhost,
|
|
# proxying with `flush_interval -1` since headscale's node-update endpoint
|
|
# is a long-poll and needs unbuffered responses); headscale itself only
|
|
# listens on localhost.
|
|
{
|
|
services.headscale = {
|
|
enable = true;
|
|
port = 8082; # zitadel already sits on the usual 8080 on this host
|
|
|
|
settings = {
|
|
server_url = "https://vpn.mgaction.town";
|
|
|
|
dns = {
|
|
base_domain = "hosts.mgaction.town";
|
|
nameservers.global = [ "1.1.1.1" "9.9.9.9" ];
|
|
};
|
|
};
|
|
};
|
|
}
|