Merge pull request #271760 from SuperSandro2000/hass-switching-lovelace-writtable

nixos/home-assistant: fix error when switching between writable and none writable lovelace config
This commit is contained in:
Martin Weinelt 2023-12-02 23:09:25 +01:00 committed by GitHub
commit 2a57f9aeba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -455,10 +455,10 @@ in {
ln -s /etc/home-assistant/configuration.yaml "${cfg.configDir}/configuration.yaml"
'';
copyLovelaceConfig = if cfg.lovelaceConfigWritable then ''
rm -f "${cfg.configDir}/ui-lovelace.yaml"
cp --no-preserve=mode ${lovelaceConfigFile} "${cfg.configDir}/ui-lovelace.yaml"
'' else ''
rm -f "${cfg.configDir}/ui-lovelace.yaml"
ln -s /etc/home-assistant/ui-lovelace.yaml "${cfg.configDir}/ui-lovelace.yaml"
ln -fs /etc/home-assistant/ui-lovelace.yaml "${cfg.configDir}/ui-lovelace.yaml"
'';
copyCustomLovelaceModules = if cfg.customLovelaceModules != [] then ''
mkdir -p "${cfg.configDir}/www"