From d0faffad2287ab006e4f1be22ca4213700284927 Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Sat, 6 Jun 2026 23:26:22 -0700 Subject: [PATCH] nixos/home-assistant: open firewall ports for homekit component --- .../services/home-automation/home-assistant.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/home-automation/home-assistant.nix b/nixos/modules/services/home-automation/home-assistant.nix index 687128b81f4e..382c09cb0fa3 100644 --- a/nixos/modules/services/home-automation/home-assistant.nix +++ b/nixos/modules/services/home-automation/home-assistant.nix @@ -864,12 +864,19 @@ in networking.firewall.allowedTCPPorts = mkMerge [ (mkIf cfg.openFirewall [ cfg.config.http.server_port ]) - (mkIf cfg.openFirewallForComponents + (mkIf cfg.openFirewallForComponents ( + # https://www.home-assistant.io/integrations/homekit/#firewall + optionals (useComponent "homekit") [ 21063 ] # https://www.home-assistant.io/integrations/sonos/#network-requirements - (optionals (useComponent "sonos") [ 1400 ]) - ) + ++ optionals (useComponent "sonos") [ 1400 ] + )) ]; + networking.firewall.allowedUDPPorts = mkIf cfg.openFirewallForComponents ( + # https://www.home-assistant.io/integrations/homekit/#firewall + optionals (useComponent "homekit") [ 5353 ] + ); + # symlink the configuration to /etc/home-assistant environment.etc = mkMerge [ (mkIf (cfg.config != null && !cfg.configWritable) {