nixos/server/home-assistant/mosquitto.nix
2026-01-14 01:41:00 +01:00

23 lines
532 B
Nix

{ lib, config, ... }:
{
config = lib.mkIf config.server.home-assistant.enable {
sops.secrets."home-assistant/mosquitto/hass" = { };
services.mosquitto = {
enable = true;
listeners = [
{
address = "192.168.178.111";
port = 1883;
users.hass = {
acl = [ "readwrite #" ];
hashedPasswordFile = config.sops.secrets."home-assistant/mosquitto/hass".path;
};
}
];
};
networking.firewall.allowedTCPPorts = [ 1883 ];
};
}