From b770ffed1bb4f552b062e3bd210c7cd3c9cef622 Mon Sep 17 00:00:00 2001 From: Joel Grunbaum <joelgrun@gmail.com> Date: Wed, 16 Jul 2025 12:55:03 +0000 Subject: [PATCH] Use zigbee2mqtt --- nixos/home-assistant.nix | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 54 insertions(+), 1 deletions(-) diff --git a/nixos/home-assistant.nix b/nixos/home-assistant.nix index 666a2b4..a7b5e21 100644 --- a/nixos/home-assistant.nix +++ b/nixos/home-assistant.nix @@ -1,6 +1,23 @@ { config, libs, pkgs, modulesPath, ... }: +let + unstable = import <nixos-unstable> {}; +in { + nixpkgs.overlays = [ + (self: super: { + inherit (unstable) home-assistant; + }) + ]; + + disabledModules = [ + "services/home-automation/home-assistant.nix" + ]; + + imports = [ + <nixos-unstable/nixos/modules/services/home-automation/home-assistant.nix> + ]; + services.home-assistant = { enable = true; extraComponents = [ @@ -13,10 +30,11 @@ # Recommended for fast zlib compression # https://www.home-assistant.io/integrations/isal "isal" - "zha" + "mqtt" "plex" "braviatv" "roku" + "unifi" ]; config = { # Includes dependencies for a basic setup @@ -32,6 +50,41 @@ }; }; }; + + services.mosquitto = { + enable = true; + listeners = [ + { + acl = [ "pattern readwrite #" ]; + omitPasswordAuth = true; + settings.allow_anonymous = true; + } + ]; + }; + + services.zigbee2mqtt = { + enable = true; + settings = { + homeassistant = true; + permit_join = true; + mqtt = { + base_topic = "zigbee2mqtt"; + server = "mqtt://127.0.0.1:1883"; + }; + serial = { + port = "/dev/ttyUSB0"; + adapter = "ember"; + }; + frontend = { + enabled = true; + port = 18080; + host = "0.0.0.0"; + }; + }; + }; + +# networking.firewall.allowedTCPPorts = [ 18080 ]; + services.nginx.virtualHosts."home.ush.bouncr.xyz" = { extraConfig = '' proxy_buffering off; -- Gitblit v1.10.0