From 052a80567948d3dad69d016bfd0a139b0f75fbd9 Mon Sep 17 00:00:00 2001 From: ibizaman Date: Fri, 17 Nov 2023 22:52:51 -0800 Subject: [PATCH] skip part of home assistant onboarding because we use LDAP --- modules/home-assistant.nix | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/modules/home-assistant.nix b/modules/home-assistant.nix index 7c49545..dc9b39c 100644 --- a/modules/home-assistant.nix +++ b/modules/home-assistant.nix @@ -94,10 +94,12 @@ in logger.default = "info"; homeassistant = { external_url = "https://${cfg.subdomain}.${cfg.domain}"; + name = "!secret name"; country = "!secret country"; latitude = "!secret latitude_home"; longitude = "!secret longitude_home"; - time_zone = "America/Los_Angeles"; + time_zone = "!secret time_zone"; + unit_system = "metric"; auth_providers = [ # Ensure you have the homeassistant provider enabled if you want to continue using your existing accounts # { type = "homeassistant"; } @@ -157,6 +159,27 @@ in }; }; + systemd.services.home-assistant.preStart = + let + onboarding = pkgs.writeText "onboarding" '' + { + "version": 4, + "minor_version": 1, + "key": "onboarding", + "data": { + "done": [ + "user", + "core_config" + ] + } + } + ''; + file = "${config.services.home-assistant.configDir}/.storage/onboarding"; + in + '' + -f ${file} || cp ${onboarding} ${file} + ''; + sops.secrets."home-assistant" = { inherit (cfg) sopsFile; mode = "0440";