services: tailscale: make exit node optional

This commit is contained in:
Antoine Martin 2021-07-14 00:08:40 +02:00
parent c16d8513d2
commit 829632e360
2 changed files with 8 additions and 2 deletions

View file

@ -123,7 +123,10 @@ in
enable = true; enable = true;
}; };
tailscale.enable = true; tailscale = {
enable = true;
exitNode = true;
};
tgv = { tgv = {
enable = true; enable = true;

View file

@ -8,6 +8,9 @@ in
{ {
options.my.services.tailscale = { options.my.services.tailscale = {
enable = lib.mkEnableOption "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 { config = mkIf cfg.enable {
@ -27,7 +30,7 @@ in
}; };
# enable IP forwarding to use as exit node # enable IP forwarding to use as exit node
boot.kernel.sysctl = { boot.kernel.sysctl = mkIf cfg.exitNode {
"net.ipv6.conf.all.forwarding" = true; "net.ipv6.conf.all.forwarding" = true;
"net.ipv4.ip_forward" = true; "net.ipv4.ip_forward" = true;
}; };