nixos/home-assistant: fix error when switching between writable and none writable lovelace config
error message before was: cp: not writing through dangling symlink '/var/lib/hass/ui-lovelace.yaml'
This commit is contained in:
@@ -455,10 +455,10 @@ in {
|
|||||||
ln -s /etc/home-assistant/configuration.yaml "${cfg.configDir}/configuration.yaml"
|
ln -s /etc/home-assistant/configuration.yaml "${cfg.configDir}/configuration.yaml"
|
||||||
'';
|
'';
|
||||||
copyLovelaceConfig = if cfg.lovelaceConfigWritable then ''
|
copyLovelaceConfig = if cfg.lovelaceConfigWritable then ''
|
||||||
|
rm -f "${cfg.configDir}/ui-lovelace.yaml"
|
||||||
cp --no-preserve=mode ${lovelaceConfigFile} "${cfg.configDir}/ui-lovelace.yaml"
|
cp --no-preserve=mode ${lovelaceConfigFile} "${cfg.configDir}/ui-lovelace.yaml"
|
||||||
'' else ''
|
'' else ''
|
||||||
rm -f "${cfg.configDir}/ui-lovelace.yaml"
|
ln -fs /etc/home-assistant/ui-lovelace.yaml "${cfg.configDir}/ui-lovelace.yaml"
|
||||||
ln -s /etc/home-assistant/ui-lovelace.yaml "${cfg.configDir}/ui-lovelace.yaml"
|
|
||||||
'';
|
'';
|
||||||
copyCustomLovelaceModules = if cfg.customLovelaceModules != [] then ''
|
copyCustomLovelaceModules = if cfg.customLovelaceModules != [] then ''
|
||||||
mkdir -p "${cfg.configDir}/www"
|
mkdir -p "${cfg.configDir}/www"
|
||||||
|
|||||||
Reference in New Issue
Block a user