diff options
| author | seth <[email protected]> | 2023-05-14 09:03:44 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-05-14 09:05:27 -0400 |
| commit | bbedc6d466ef240c2ff1956e4155fdeb8dfc6d78 (patch) | |
| tree | da2b0def5f3657ba89dead5918edfbc91b69a9fe /modules/nixos/features/tailscale.nix | |
| parent | f2e62b9f30453afb3b633bc2c1462a406c12afa4 (diff) | |
hosts: start using tailscale + endlessh -> fail2ban
Diffstat (limited to 'modules/nixos/features/tailscale.nix')
| -rw-r--r-- | modules/nixos/features/tailscale.nix | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/modules/nixos/features/tailscale.nix b/modules/nixos/features/tailscale.nix new file mode 100644 index 0000000..d2c8b20 --- /dev/null +++ b/modules/nixos/features/tailscale.nix @@ -0,0 +1,23 @@ +{ + config, + lib, + ... +}: let + cfg = config.getchoo.features.tailscale; + inherit (lib) mkDefault mkEnableOption mkIf; +in { + options.getchoo.features.tailscale.enable = mkEnableOption "enable support for tailscale"; + + config = mkIf cfg.enable { + services = { + openssh.openFirewall = false; + tailscale.enable = mkDefault true; + }; + + networking.firewall = { + allowedUDPPorts = [config.services.tailscale.port]; + checkReversePath = "loose"; + trustedInterfaces = mkDefault ["tailscale0"]; + }; + }; +} |
