Retain platformio cache

As compiling might take long, it is not a good idea to remove the
platformio cache with the `rsync --delete` on every deployment.
This commit is contained in:
Jakob Lechner 2024-02-21 17:53:52 +00:00
parent 66fe0d9539
commit f3383f21a8

View file

@ -43,9 +43,21 @@ in
system.activationScripts.esphome-custom = {
deps = [ "users" "groups" ];
text = ''
mkdir -p "${stateDir}/.esphome"
${pkgs.rsync}/bin/rsync -a --delete "${cfgdir}/" "${stateDir}/"
chown esphome:esphome "${stateDir}/"
${pkgs.rsync}/bin/rsync \
-a \
--delete \
--exclude=.esphome \
--exclude=.platformio \
--exclude=.gitignore \
"${cfgdir}/" "${stateDir}/"
mkdir -p \
"${stateDir}/.esphome" \
"${stateDir}/.platformio"
touch "${stateDir}/.gitignore"
chown esphome:esphome \
"${stateDir}/" \
"${stateDir}/.esphome" \
"${stateDir}/.platformio"
'';
};
}