From 852641b0dc591af813b19298155a561f50332215 Mon Sep 17 00:00:00 2001 From: mjallen18 Date: Mon, 3 Feb 2025 18:59:49 -0600 Subject: [PATCH] node --- hosts/nas/apps/homeassistant/default.nix | 54 ++++++++++++++++++++++++ hosts/nas/apps/nextcloud/default.nix | 1 + 2 files changed, 55 insertions(+) create mode 100644 hosts/nas/apps/homeassistant/default.nix diff --git a/hosts/nas/apps/homeassistant/default.nix b/hosts/nas/apps/homeassistant/default.nix new file mode 100644 index 0000000..9f5cb7c --- /dev/null +++ b/hosts/nas/apps/homeassistant/default.nix @@ -0,0 +1,54 @@ +{ config, pkgs, ... }: +{ + homeassistant = { + enable = true; + extraComponents = [ + # Components required to complete the onboarding + "analytics" + "google_translate" + "met" + "radio_browser" + "shopping_list" + # Recommended for fast zlib compression + # https://www.home-assistant.io/integrations/isal + "isal" + ]; + customComponents = with pkgs.home-assistant-custom-components; [ + auth-header + # bambulab + # ge_home + # mail_and_packages + # overseerr + # petlibro + # subaru + # vesync + # wyze-api + ]; + # use postgresql instead of sqlite + extraPackages = ps: with ps; [ psycopg2 ]; + config.recorder.db_url = "postgresql://@/hass"; + config = { + "automation ui" = "!include automations.yaml"; + "scene ui" = "!include scenes.yaml"; + "script ui" = "!include scripts.yaml"; + # https://www.home-assistant.io/integrations/ota_updater/ + zha.zigpy_config.ota.z2m_remote_index = "https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master/index.json"; + }; + }; + + # https://www.home-assistant.io/integrations/automation/ + systemd.tmpfiles.rules = [ + "f ${config.services.home-assistant.configDir}/automations.yaml 0755 hass hass" + ]; + + + services.postgresql = { + enable = true; + dataDir = "/media/nas/ssd/nix-apps/postgresql"; + ensureDatabases = [ "hass" ]; + ensureUsers = [{ + name = "hass"; + ensureDBOwnership = true; + }]; + }; +} \ No newline at end of file diff --git a/hosts/nas/apps/nextcloud/default.nix b/hosts/nas/apps/nextcloud/default.nix index c0359db..27a556e 100644 --- a/hosts/nas/apps/nextcloud/default.nix +++ b/hosts/nas/apps/nextcloud/default.nix @@ -115,6 +115,7 @@ in # System packages environment.systemPackages = with pkgs; [ nextcloud30 + nodejs # onlyoffice-documentserver sqlite ];