diff --git a/modules/system/services/tailscale/default.nix b/modules/system/services/tailscale.nix similarity index 86% rename from modules/system/services/tailscale/default.nix rename to modules/system/services/tailscale.nix index eea3ba7..5028a03 100644 --- a/modules/system/services/tailscale/default.nix +++ b/modules/system/services/tailscale.nix @@ -20,8 +20,7 @@ in enable = true; authKeyFile = config.sops.secrets."tailscale-auth-key".path; openFirewall = true; - useRoutingFeatures = - if (cfg.exitNode.enable || (cfg.serve.target != null)) then "server" else "client"; + useRoutingFeatures = if cfg.exitNode.enable then "server" else "client"; extraUpFlags = [ "--reset=true" ]; extraSetFlags = [ "--ssh=${lib.boolToString cfg.ssh.enable}" diff --git a/modules/system/services/tailscale/serve-funnel.nix b/modules/system/services/tailscale/serve-funnel.nix deleted file mode 100644 index 5d8ce33..0000000 --- a/modules/system/services/tailscale/serve-funnel.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -let - cfg = config.custom.services.tailscale; -in -{ - options.custom.services.tailscale.serve = { - isFunnel = lib.mkEnableOption ""; - target = lib.mkOption { - type = lib.types.nullOr lib.types.nonEmptyStr; - default = null; - }; - }; - - config = lib.mkIf cfg.enable { - systemd.services = - let - mode = if cfg.serve.isFunnel then "funnel" else "serve"; - in - { - "tailscaled-${mode}" = lib.mkIf (cfg.serve.target != null) { - after = [ - "tailscaled.service" - "tailscaled-autoconnect.service" - ]; - wants = [ "tailscaled.service" ]; - wantedBy = [ "multi-user.target" ]; - serviceConfig = { - Type = "oneshot"; - RemainAfterExit = true; - ExecStartPre = "${lib.getExe pkgs.tailscale} cert --min-validity 120h ${config.networking.hostName}.${cfg.domain}"; - ExecStart = "${lib.getExe pkgs.tailscale} ${mode} --bg ${cfg.serve.target}"; - ExecStop = "${lib.getExe pkgs.tailscale} ${mode} reset"; - Restart = "on-failure"; - }; - }; - - tailscaled-set.after = [ "tailscaled-autoconnect.service" ]; - }; - }; -}