nixos/hosts/architect/headscale.nix

50 lines
1.1 KiB
Nix
Raw Permalink Normal View History

2024-01-30 23:33:56 +00:00
{ config, pkgs, ... }:
2023-05-06 14:04:25 +01:00
let
domain = "vipienne.giugl.io";
headscalePkg = pkgs.headscale;
2023-05-06 14:04:25 +01:00
in
{
2024-01-30 23:33:56 +00:00
environment.systemPackages = [ headscalePkg ];
2023-07-07 01:16:40 +01:00
2024-01-30 23:33:56 +00:00
architect = {
firewall = {
openUDP = [ config.services.tailscale.port ];
2023-05-06 14:04:25 +01:00
};
2024-01-30 23:33:56 +00:00
vhost.${domain} = {
dnsInterfaces = [ "lan" "tailscale" ];
2023-05-06 14:04:25 +01:00
locations."/" = {
2024-01-30 23:33:56 +00:00
port = config.services.headscale.port;
allowWAN = true;
2023-05-06 14:04:25 +01:00
proxyWebsockets = true;
};
};
};
2024-01-30 23:33:56 +00:00
services.headscale = {
enable = true;
package = headscalePkg;
2024-02-21 11:33:08 +00:00
port = 1194;
2024-01-30 23:33:56 +00:00
settings = {
server_url = "https://${domain}";
# log.level = "debug";
dns = {
2024-01-30 23:33:56 +00:00
magic_dns = false;
# base_domain = domain;
2024-01-30 23:33:56 +00:00
override_local_dns = true;
global = [
config.architect.networks.tailscale.devices.architect.address
];
nameservers.global = [
2024-01-30 23:33:56 +00:00
config.architect.networks.tailscale.devices.architect.address
];
};
logtail.enabled = false;
prefixes.v4 = config.architect.networks.tailscale.net;
2024-01-30 23:33:56 +00:00
noise.private_key_path = "/var/lib/headscale/noise_private.key";
};
};
2023-05-06 14:04:25 +01:00
}