Remove tailscale serve/funncel module

This commit is contained in:
SebastianStork 2025-05-29 19:22:47 +02:00
parent 294bebdb98
commit 00adb88940
2 changed files with 1 additions and 47 deletions

View file

@ -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}"

View file

@ -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" ];
};
};
}