{ pkgs, config, lib, ... }: let cfg = config.modules.system.tailscale; authkey_file = "/run/secrets/tailscale_authkey"; in { options.modules.system.tailscale = { enable = lib.mkEnableOption "enables tailscale"; }; config = lib.mkIf cfg.enable { services.tailscale = { enable = true; useRoutingFeatures = "both"; authKeyFile = authkey_file; }; }; }