{ lib, config, pkgs, ... }: with lib; let cfg = config.pub-solar.home-assistant; in { config = mkIf cfg.enable { networking.firewall.allowedUDPPorts = [1900]; services.home-assistant = { enable = true; openFirewall = true; extraComponents = cfg.extraComponents ++ lib.optionals cfg.mqtt.enable ["mqtt"]; extraPackages = cfg.extraPackages; config = cfg.config; }; }; }