fix: home assistant config
This commit is contained in:
@@ -7,80 +7,68 @@ let
|
|||||||
rev = "18dd725c29603f582cf1900e0d25f9f1063dbf11";
|
rev = "18dd725c29603f582cf1900e0d25f9f1063dbf11";
|
||||||
}) {};
|
}) {};
|
||||||
|
|
||||||
haOld = config.services.home-assistant;
|
ha-extraComponents = config.services.home-assistant.extraComponents ++ [
|
||||||
haClean = builtins.removeAttrs haOld [ "autoExtraComponents" "applyDefaultConfig" ];
|
"mobile_app"
|
||||||
|
"backup"
|
||||||
|
];
|
||||||
|
|
||||||
home-assistant-config = lib.recursiveUpdate haClean {
|
ha-config = lib.recursiveUpdate config.services.home-assistant.config let
|
||||||
package = pkgs-with-home-assistant.home-assistant;
|
hiddenEntities = [
|
||||||
extraComponents = [
|
"sensor.last_boot"
|
||||||
"mobile_app"
|
"sensor.date"
|
||||||
"backup"
|
|
||||||
];
|
];
|
||||||
|
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";
|
||||||
|
|
||||||
extraPackages = ps: with ps; [
|
};
|
||||||
mysqlclient
|
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";
|
||||||
|
};
|
||||||
|
|
||||||
config =
|
network = { };
|
||||||
let
|
zeroconf = { };
|
||||||
hiddenEntities = [
|
system_health = { };
|
||||||
"sensor.last_boot"
|
default_config = { };
|
||||||
"sensor.date"
|
system_log = { };
|
||||||
];
|
}
|
||||||
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;
|
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";
|
||||||
|
|||||||
Reference in New Issue
Block a user