diff --git a/flake.nix b/flake.nix index b12a0a9..686febb 100644 --- a/flake.nix +++ b/flake.nix @@ -26,7 +26,7 @@ }; deploy.nodes.bastion = { - hostname = "localhost"; + hostname = "10.42.42.4"; fastConnection = true; profiles.system = { user = "root"; diff --git a/hosts/mosquitto/configuration.nix b/hosts/mosquitto/configuration.nix index 828b5d2..0ee6eb2 100644 --- a/hosts/mosquitto/configuration.nix +++ b/hosts/mosquitto/configuration.nix @@ -30,6 +30,9 @@ victor = { acl = ["topic readwrite #"]; }; + zigbee2mqtt = { + acl = ["topic readwrite #"]; + }; }; enable = true; port = 1883; @@ -37,5 +40,24 @@ allowAnonymous = true; }; + services.zigbee2mqtt = { + enable = true; + dataDir = "/var/lib/zigbee2mqtt"; + settings = { + homeassistant = false; + permit_join = true; + + serial = { + port = "/dev/ttyUSB0"; + }; + + mqtt = { + base_topic = "zigbee2mqtt"; + server = "mqtt://localhost:${toString config.services.mosquitto.port}"; + user = "zigbee2mqtt"; + }; + }; + }; + networking.firewall.allowedTCPPorts = [ config.services.mosquitto.port ]; }