From 829632e36031d3ebfe477731c76b082b25080df1 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 14 Jul 2021 00:08:40 +0200 Subject: [PATCH] services: tailscale: make exit node optional --- hosts/poseidon/default.nix | 5 ++++- services/tailscale.nix | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hosts/poseidon/default.nix b/hosts/poseidon/default.nix index b81dbf3..c96fc35 100644 --- a/hosts/poseidon/default.nix +++ b/hosts/poseidon/default.nix @@ -123,7 +123,10 @@ in enable = true; }; - tailscale.enable = true; + tailscale = { + enable = true; + exitNode = true; + }; tgv = { enable = true; diff --git a/services/tailscale.nix b/services/tailscale.nix index 75fef50..cb239df 100644 --- a/services/tailscale.nix +++ b/services/tailscale.nix @@ -8,6 +8,9 @@ in { options.my.services.tailscale = { enable = lib.mkEnableOption "Tailscale"; + + # NOTE: still have to do `tailscale up --advertise-exit-node` + exitNode = lib.mkEnableOption "Use as exit node"; }; config = mkIf cfg.enable { @@ -27,7 +30,7 @@ in }; # enable IP forwarding to use as exit node - boot.kernel.sysctl = { + boot.kernel.sysctl = mkIf cfg.exitNode { "net.ipv6.conf.all.forwarding" = true; "net.ipv4.ip_forward" = true; };