fix(rpi4): fix home-assistant config
This commit is contained in:
parent
c87de43103
commit
e0f55dfb08
|
@ -4,6 +4,7 @@ with pkgs;
|
|||
|
||||
let
|
||||
mqttDomain = "mqtt.${config.networking.domain}";
|
||||
mqttPort = 1883;
|
||||
mqttWSPort = 9001;
|
||||
in {
|
||||
# just installed for ConBee firmware updates
|
||||
|
@ -23,20 +24,21 @@ in {
|
|||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:8123";
|
||||
proxyPass =
|
||||
"http://localhost:${toString config.services.home-assistant.port}";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ mqttWSPort ];
|
||||
networking.firewall.allowedTCPPorts = [ mqttPort ];
|
||||
|
||||
services.mosquitto = {
|
||||
enable = true;
|
||||
listeners = [{
|
||||
port = mqttWSPort;
|
||||
settings.protocol = "websockets";
|
||||
listeners = [
|
||||
{
|
||||
port = mqttPort;
|
||||
users = {
|
||||
"hass" = {
|
||||
acl = [
|
||||
|
@ -54,6 +56,12 @@ in {
|
|||
acl = [ "readwrite owntracks/#" ];
|
||||
hashedPasswordFile = "/etc/nixos/secrets/mqtt/owntracks";
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
port = mqttWSPort;
|
||||
settings.protocol = "websockets";
|
||||
users = {
|
||||
"felix" = {
|
||||
acl = [ "read owntracks/#" "readwrite owntracks/felix/#" ];
|
||||
hashedPasswordFile = "/etc/nixos/secrets/mqtt/felix";
|
||||
|
@ -63,7 +71,8 @@ in {
|
|||
hashedPasswordFile = "/etc/nixos/secrets/mqtt/birgit";
|
||||
};
|
||||
};
|
||||
}];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
services.home-assistant = {
|
||||
|
@ -105,7 +114,7 @@ in {
|
|||
};
|
||||
mqtt = {
|
||||
broker = "localhost";
|
||||
port = mqttWSPort;
|
||||
port = mqttPort;
|
||||
username = "hass";
|
||||
password = "!secret mqtt_password";
|
||||
discovery = true;
|
||||
|
|
Loading…
Reference in a new issue