os/modules/home-assistant/mqtt.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
370 B
Nix
Raw Normal View History

2023-06-12 15:04:12 +00:00
{
lib,
config,
pkgs,
...
}:
with lib; let
haCfg = config.pub-solar.home-assistant;
cfg = config.pub-solar.home-assistant.mqtt;
in {
config = mkIf (haCfg.enable && cfg.enable) {
networking.firewall.allowedTCPPorts = [
1883 # mosquitto
];
services.mosquitto = {
enable = true;
listeners = [{users = cfg.users;}];
};
};
}