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