fix: home assistant config

This commit is contained in:
2025-04-29 09:55:56 +02:00
parent a392749343
commit 22d1abe5ba

View File

@@ -7,28 +7,17 @@ let
rev = "18dd725c29603f582cf1900e0d25f9f1063dbf11"; rev = "18dd725c29603f582cf1900e0d25f9f1063dbf11";
}) {}; }) {};
haOld = config.services.home-assistant; ha-extraComponents = config.services.home-assistant.extraComponents ++ [
haClean = builtins.removeAttrs haOld [ "autoExtraComponents" "applyDefaultConfig" ];
home-assistant-config = lib.recursiveUpdate haClean {
package = pkgs-with-home-assistant.home-assistant;
extraComponents = [
"mobile_app" "mobile_app"
"backup" "backup"
]; ];
extraPackages = ps: with ps; [ ha-config = lib.recursiveUpdate config.services.home-assistant.config let
mysqlclient
];
config =
let
hiddenEntities = [ hiddenEntities = [
"sensor.last_boot" "sensor.last_boot"
"sensor.date" "sensor.date"
]; ];
in in {
{
recorder = { recorder = {
db_url = "mysql://hass@localhost/hass?unix_socket=/var/run/mysqld/mysqld.sock"; db_url = "mysql://hass@localhost/hass?unix_socket=/var/run/mysqld/mysqld.sock";
}; };
@@ -79,8 +68,7 @@ let
system_health = { }; system_health = { };
default_config = { }; default_config = { };
system_log = { }; system_log = { };
}; }
};
uid = config.ids.uids.hass; uid = config.ids.uids.hass;
gid = config.ids.gids.hass; gid = config.ids.gids.hass;
@@ -91,7 +79,6 @@ in
createHome = true; createHome = true;
group = "hass"; group = "hass";
uid = uid; uid = uid;
isSystemUser = true;
extraGroups = [ "dialout" ]; extraGroups = [ "dialout" ];
}; };
users.groups.hass.gid = gid; users.groups.hass.gid = gid;
@@ -164,7 +151,16 @@ in
pkgs.mariadb pkgs.mariadb
]; ];
services.home-assistant = home-assistant-config; services.home-assistant = {
package = pkgs-with-home-assistant.home-assistant;
extraComponents = ha-extraComponents;
extraPackages = ps: with ps; [
mysqlclient
];
config = ha-config;
};
systemd.services.install-hacs = { systemd.services.install-hacs = {
description = "Install HACS"; description = "Install HACS";