Nix flake configuration for my various machines (clients and homelab servers)
0

Configure Feed

Select the types of activity you want to include in your feed.

tailscale: add server mode with ssh/exit node

Parthiv Krishna (Jun 23, 2026, 12:19 AM -0700) 5f340a1a 6ca71036

+19 -3
+15 -2
modules/features/networking/tailscale.nix
··· 5 5 "tailscale" 6 6 ]; 7 7 8 + extraOptions = { 9 + isServer = lib.mkOption { 10 + type = lib.types.bool; 11 + default = false; 12 + description = "If this machine is a server, enable ssh and exit node"; 13 + example = true; 14 + }; 15 + }; 16 + 8 17 systemConfig = 9 - _cfg: 18 + cfg: 10 19 { config, ... }: 11 20 let 12 21 secretName = "tailscale/key"; ··· 15 24 services.tailscale = { 16 25 enable = true; 17 26 authKeyFile = config.sops.secrets.${secretName}.path; 18 - extraUpFlags = [ "--ssh" ]; 27 + useRoutingFeatures = lib.mkIf cfg.isServer "server"; 28 + extraUpFlags = lib.mkIf cfg.isServer [ 29 + "--advertise-exit-node" 30 + "--ssh" 31 + ]; 19 32 }; 20 33 21 34 sops.secrets.${secretName} = { };
+4 -1
modules/manifests/server.nix
··· 9 9 smartmontools.enable = lib.mkDefault true; 10 10 usbutils.enable = lib.mkDefault true; 11 11 }; 12 - networking.sshd.enable = lib.mkDefault true; 12 + networking = { 13 + sshd.enable = lib.mkDefault true; 14 + tailscale.isServer = lib.mkDefault true; 15 + }; 13 16 }; 14 17 }; 15 18 }