summaryrefslogtreecommitdiff
path: root/os/srv/tailscale.nix
blob: 5c8d72e4a95bbb65dc59410312f775413d100eec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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";
    };
  };
}