{ config, lib, pkgs, ... }:

with lib;

let cfg = config.sydnix.tailscale;
in {
  options = {
    sydnix.tailscale = {
      enable = mkEnableOption "Tailscale";
    };
  };

  config = mkIf cfg.enable {
    services.tailscale.enable = true;

    networking.firewall.trustedInterfaces = [
      "36mtailscale0"
    ];
  };
}
