summaryrefslogtreecommitdiff
path: root/os/srv/tailscale.nix
diff options
context:
space:
mode:
Diffstat (limited to 'os/srv/tailscale.nix')
-rw-r--r--os/srv/tailscale.nix19
1 files changed, 19 insertions, 0 deletions
diff --git a/os/srv/tailscale.nix b/os/srv/tailscale.nix
new file mode 100644
index 0000000..5c8d72e
--- /dev/null
+++ b/os/srv/tailscale.nix
@@ -0,0 +1,19 @@
+{ config, lib, ... }:
+let
+ cfg = config.os.srv.tailscale;
+in
+{
+ options.os.srv.tailscale.enable = lib.mkEnableOption "enables tailscale vpn";
+
+ config = lib.mkIf cfg.enable {
+ services.tailscale = {
+ enable = true;
+ openFirewall = true;
+ useRoutingFeatures = "client";
+ };
+ networking.firewall = {
+ trustedInterfaces = [ "tailscale0" ];
+ checkReversePath = "loose";
+ };
+ };
+}