aboutsummaryrefslogtreecommitdiff
path: root/hosts/sagittarius/headscale.nix
blob: 4a261c26d667ed0bc8a792025b52b87ea475b1ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{ config, ... }:
let
  domain = "headscale.sorre.xyz";
  port = 5892;
in
{
  services.headscale = {
    enable = true;
    inherit port;
    address = "127.0.0.1";
    settings = {
      server_url = "https://${domain}";
      dns.base_domain = "sorre.internal";
      dns.nameservers.global = [ "1.1.1.1" "2301:db8:acad:a::1" ];
    };
  };

  services.nginx.virtualHosts."${domain}" = {
    forceSSL = true;
    enableACME = true;
    locations."/" = {
      proxyPass = "http://localhost:${toString port}";
      proxyWebsockets = true;
    };
  };

  environment.systemPackages = [ config.services.headscale.package ];
}