{ 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"; }; }; }