From da2e1ff0e1ea6f0d9e881c92d4926558588f0222 Mon Sep 17 00:00:00 2001 From: ibizaman Date: Sat, 9 Dec 2023 10:31:51 -0800 Subject: [PATCH] fix storage creation in homeassistant on first run --- modules/services/home-assistant.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/services/home-assistant.nix b/modules/services/home-assistant.nix index dc9b39c..2cd9ba1 100644 --- a/modules/services/home-assistant.nix +++ b/modules/services/home-assistant.nix @@ -174,10 +174,13 @@ in } } ''; - file = "${config.services.home-assistant.configDir}/.storage/onboarding"; + storage = "${config.services.home-assistant.configDir}/.storage"; + file = "${storage}/onboarding"; in '' - -f ${file} || cp ${onboarding} ${file} + if ! -f ${file}; then + mkdir -p ${storage} && cp ${onboarding} ${file} + fi ''; sops.secrets."home-assistant" = {