From 456395f731b1a7b1f601aa83defec58154aaae96 Mon Sep 17 00:00:00 2001 From: Dominik Polakovics Date: Mon, 28 Apr 2025 23:50:42 +0200 Subject: [PATCH] fix: remove multiple recursiveUpdate --- .../home-assistant/default.nix | 140 +++++++++--------- 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/modules/cloonar-assistant/home-assistant/default.nix b/modules/cloonar-assistant/home-assistant/default.nix index 3b19bee..4ed7445 100644 --- a/modules/cloonar-assistant/home-assistant/default.nix +++ b/modules/cloonar-assistant/home-assistant/default.nix @@ -9,7 +9,76 @@ let home-assistant-config = recursiveUpdate config.home-assistant { package = pkgs-with-home-assistant.home-assistant; + extraComponents = [ + "mobile_app" + "backup" + ]; + + extraPackages = ps: with ps; [ + mysqlclient + ]; + + config = + let + hiddenEntities = [ + "sensor.last_boot" + "sensor.date" + ]; + in + { + recorder = { + db_url = "mysql://hass@localhost/hass?unix_socket=/var/run/mysqld/mysqld.sock"; + }; + homeassistant = { + name = "Home"; + latitude = "!secret home_latitude"; + longitude = "!secret home_longitude"; + elevation = "!secret home_elevation"; + unit_system = "metric"; + currency = "EUR"; + country = "AT"; + time_zone = "Europe/Vienna"; + external_url = "https://${domain}"; + }; + zone = { + name = "Home"; + latitude = "!secret home_latitude"; + longitude = "!secret home_longitude"; + radius = 35; + icon = "mdi:account-multiple"; + + }; + automation = "!include automations.yaml"; + frontend = { }; + http = { + use_x_forwarded_for = true; + trusted_proxies = [ + "127.0.0.1" + "::1" + ]; + }; + api = { }; + history.exclude = { + entities = hiddenEntities; + domains = [ + "automation" + "updater" + ]; + }; + "map" = { }; + # logbook.exclude.entities = "hiddenEntities"; + logger = { + default = "warning"; + }; + + network = { }; + zeroconf = { }; + system_health = { }; + default_config = { }; + system_log = { }; + }; }; + uid = config.ids.uids.hass; gid = config.ids.gids.hass; in @@ -78,76 +147,7 @@ in pkgs.mariadb ]; - services.home-assistant = recursiveUpdate home-assistant-config { - extraComponents = [ - "mobile_app" - "backup" - ]; - - extraPackages = ps: with ps; [ - mysqlclient - ]; - - config = - let - hiddenEntities = [ - "sensor.last_boot" - "sensor.date" - ]; - in - { - recorder = { - db_url = "mysql://hass@localhost/hass?unix_socket=/var/run/mysqld/mysqld.sock"; - }; - homeassistant = { - name = "Home"; - latitude = "!secret home_latitude"; - longitude = "!secret home_longitude"; - elevation = "!secret home_elevation"; - unit_system = "metric"; - currency = "EUR"; - country = "AT"; - time_zone = "Europe/Vienna"; - external_url = "https://${domain}"; - }; - zone = { - name = "Home"; - latitude = "!secret home_latitude"; - longitude = "!secret home_longitude"; - radius = 35; - icon = "mdi:account-multiple"; - - }; - automation = "!include automations.yaml"; - frontend = { }; - http = { - use_x_forwarded_for = true; - trusted_proxies = [ - "127.0.0.1" - "::1" - ]; - }; - api = { }; - history.exclude = { - entities = hiddenEntities; - domains = [ - "automation" - "updater" - ]; - }; - "map" = { }; - # logbook.exclude.entities = "hiddenEntities"; - logger = { - default = "warning"; - }; - - network = { }; - zeroconf = { }; - system_health = { }; - default_config = { }; - system_log = { }; - }; - }; + services.home-assistant = home-assistant-config; systemd.services.install-hacs = { description = "Install HACS";