mirror of https://github.com/Chizi123/Dotfiles.git

Joel Grunbaum
yesterday b770ffed1bb4f552b062e3bd210c7cd3c9cef622
Use zigbee2mqtt
1 files modified
55 ■■■■■ changed files
nixos/home-assistant.nix 55 ●●●●● patch | view | raw | blame | history
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;