nixos-config/configs/pepe/home-assistant/mqtt.nix
2020-06-01 04:12:15 +02:00

31 lines
738 B
Nix

{ lib, ... }: {
services.homeAssistantConfig.mqtt = {
# discovery = false;
# for mosquitto
broker = "127.0.0.1";
username = lib.fileContents <secrets/home-assistant/mqtt-user>;
password = lib.fileContents <secrets/home-assistant/mqtt-password>;
};
services.mosquitto = {
enable = true;
host = "0.0.0.0";
users = {
homeassistant = {
password = lib.fileContents <secrets/mosquitto/password>;
acl = [ "topic readwrite #" ];
};
zigbee = {
password = lib.fileContents <secrets/zigbee/password>;
acl = [ "topic readwrite #" ];
};
lightcontrol = {
password = "password";
acl = [ "topic readwrite #" ];
};
};
};
}