From c7e9ff3c853755cd3b0e8bc7443d55d222a06f80 Mon Sep 17 00:00:00 2001 From: Collin Williams <96917990+bluedragon1221@users.noreply.github.com> Date: Sun, 11 Jan 2026 08:03:03 -0600 Subject: clean up services/networking config even more --- modules/services/nixos/selfhost/headscale.nix | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'modules/services/nixos/selfhost/headscale.nix') diff --git a/modules/services/nixos/selfhost/headscale.nix b/modules/services/nixos/selfhost/headscale.nix index 9989742..2bdcca1 100644 --- a/modules/services/nixos/selfhost/headscale.nix +++ b/modules/services/nixos/selfhost/headscale.nix @@ -23,7 +23,7 @@ in address = cfg.bind_host; port = cfg.port; settings = { - server_url = cfg.root_url; + server_url = "https://${cfg.root_url}"; database.type = "sqlite"; @@ -60,9 +60,16 @@ in description = "Target represents headscale is running. started by headscale.service"; }; - services.caddy.virtualHosts.${cfg.root_url}.extraConfig = lib.mkIf config.collinux.services.selfhost.caddy.enable '' - reverse_proxy localhost:8080 - ''; - environment.systemPackages = [pkgs.headscale]; + + services.caddy = lib.mkIf cfg.caddy.enable { + virtualHosts.${cfg.root_url}.extraConfig = '' + ${ + if cfg.caddy.bind_tailscale + then "bind tailscale/${cfg.service_name}" + else "" + } + reverse_proxy ${cfg.bind_host}:${toString cfg.port} + ''; + }; } -- cgit v1.3.1