ma homeautomation: add mqtt

This commit is contained in:
makefu 2018-09-17 21:52:41 +02:00
parent e576c3182a
commit 20eebf0ca3
No known key found for this signature in database
GPG Key ID: 36F7711F3FC0F225
2 changed files with 19 additions and 0 deletions

View File

@ -2,6 +2,9 @@
let let
firetv = "192.168.1.238"; firetv = "192.168.1.238";
in { in {
imports = [
./mqtt.nix
];
systemd.services.firetv = { systemd.services.firetv = {
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
serviceConfig = { serviceConfig = {

View File

@ -0,0 +1,16 @@
{ pkgs, config, ... }:
{
services.mosquitto = {
enable = true;
host = "0.0.0.0";
allowAnonymous = false;
checkPasswords = true;
# see <host>/mosquitto
users.sensor = {
hashedPassword = "$6$2DXU7W1bvqXPqxkF$vtdz5KTd/T09hmoc9LjgEGFjvpwQbQth6vlVcr5hJNLgcBHv4U03YCKC8TKXbmQAa8xiJ76xJIg25kcL+KI3tg==";
acl = [ "topic readwrite #" ];
};
};
environment.systemPackages = [ pkgs.mosquitto ];
networking.firewall.allowedTCPPorts = [ config.services.mosquitto.port ];
}