Fix LocalTuya install: use systemd service instead of tmpfiles
systemd-tmpfiles L+ was not creating the symlink. Replace with a oneshot service that copies the component before HA starts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
3ac9b2c518
commit
4ab92a985a
1 changed files with 16 additions and 3 deletions
|
|
@ -1281,9 +1281,22 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
systemd.services.hass-localtuya-install = {
|
||||||
"L+ /var/lib/hass/custom_components/localtuya - hass hass - ${../../configs/home-assistant/custom_components/localtuya}"
|
description = "Install LocalTuya custom component for Home Assistant";
|
||||||
];
|
before = [ "home-assistant.service" ];
|
||||||
|
wantedBy = [ "home-assistant.service" ];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
User = "hass";
|
||||||
|
RemainAfterExit = true;
|
||||||
|
};
|
||||||
|
script = ''
|
||||||
|
mkdir -p /var/lib/hass/custom_components
|
||||||
|
rm -rf /var/lib/hass/custom_components/localtuya
|
||||||
|
cp -r ${../../configs/home-assistant/custom_components/localtuya} /var/lib/hass/custom_components/localtuya
|
||||||
|
chmod -R u+rw /var/lib/hass/custom_components/localtuya
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
systemd.timers."nix-flake-update" = {
|
systemd.timers."nix-flake-update" = {
|
||||||
wantedBy = [ "timers.target" ];
|
wantedBy = [ "timers.target" ];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue