{...}: { flake.nixosModules.home-assistant-sonos = { lib, config, ... }: lib.mkIf (config.services.home-assistant.extensions.sonos.enable) { services.home-assistant.extraComponents = ["sonos"]; networking.firewall.allowedTCPPorts = [ config.services.home-assistant.extensions.sonos.port ]; }; }