diff --git a/modules/services/tailscale/default.nix b/modules/services/tailscale/default.nix index b44a870..d78e616 100644 --- a/modules/services/tailscale/default.nix +++ b/modules/services/tailscale/default.nix @@ -4,23 +4,27 @@ pkgs, myData, ... -}: { - options.mj.services.tailscale = with lib.types; { - enable = lib.mkEnableOption "Enable tailscale"; +}: let + cfg = config.mj.services.tailscale; + inherit (lib) mkMerge types mkEnableOption mkOption mkIf; +in { + options.mj.services.tailscale = with types; { + enable = mkEnableOption "Enable tailscale"; # https://github.com/tailscale/tailscale/issues/1548 - silenceLogs = lib.mkOption { + silenceLogs = mkOption { type = bool; default = false; }; }; - config = with config.mj.services.tailscale; - lib.mkIf enable { + config = mkIf (cfg.enable) (mkMerge [ + { services.tailscale.enable = true; networking.firewall.checkReversePath = "loose"; networking.firewall.allowedUDPPorts = [myData.ports.tailscale]; - #} - #// lib.mkIf silenceLogs { - # systemd.services.tailscaled.serviceConfig."StandardOutput" = "null"; - }; + } + (mkIf cfg.silenceLogs { + systemd.services.tailscaled.serviceConfig."StandardOutput" = "null"; + }) + ]); }