blob: 6faea12e258206ec41b6ab6bf3c34f341eb0858b (
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
29
30
31
32
33
34
35
|
{ config, lib, pkgs, ... }:
let
cfg = config.headscale;
in
{
options.headscale = {
domain = lib.mkOption {
type = lib.types.str;
};
};
config = {
services = {
headscale = {
enable = true;
port = 8080;
# TODO: make dataDir configurable and set it to /srv/
settings = {
server_url = "https://${cfg.domain}";
dns = { base_domain = "tailnet"; };
};
};
nginx.virtualHosts.${cfg.domain} = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://localhost:${toString config.services.headscale.port}";
proxyWebsockets = true;
};
};
};
};
}
|