summaryrefslogtreecommitdiff
path: root/os/core/tailscale.nix
blob: 795fdbb6fc336c7fc64bf83b05989f0317c01484 (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.core.tailscale;
in
{
  options.os.core.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";
    };
  };
}