2023-06-12 15:04:12 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
cfg = config.pub-solar.home-assistant;
|
|
|
|
in {
|
|
|
|
config = mkIf cfg.enable {
|
2023-10-01 20:20:38 +00:00
|
|
|
networking.firewall.allowedUDPPorts = [1900];
|
|
|
|
|
2023-06-12 15:04:12 +00:00
|
|
|
services.home-assistant = {
|
|
|
|
enable = true;
|
|
|
|
openFirewall = true;
|
|
|
|
extraComponents =
|
|
|
|
cfg.extraComponents
|
|
|
|
++ lib.optionals cfg.mqtt.enable ["mqtt"];
|
|
|
|
extraPackages = cfg.extraPackages;
|
|
|
|
config = cfg.config;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|