ma homeautomation: add mqtt
This commit is contained in:
parent
1adaa4a149
commit
1391d5c4d3
|
@ -2,6 +2,9 @@
|
|||
let
|
||||
firetv = "192.168.1.238";
|
||||
in {
|
||||
imports = [
|
||||
./mqtt.nix
|
||||
];
|
||||
systemd.services.firetv = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
|
|
16
2configs/deployment/homeautomation/mqtt.nix
Normal file
16
2configs/deployment/homeautomation/mqtt.nix
Normal 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 ];
|
||||
}
|
Loading…
Reference in a new issue