mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-22 00:21:34 +01:00
Remove tailscale serve/funncel module
This commit is contained in:
parent
294bebdb98
commit
00adb88940
2 changed files with 1 additions and 47 deletions
|
|
@ -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}"
|
||||
|
|
@ -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" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue