Add service to deploy home-assistant pyscript scripts

Signed-off-by: magic_rb <magic_rb@redalder.org>
This commit is contained in:
magic_rb 2024-01-22 00:44:17 +01:00
parent b7d82b950c
commit d925c68f58
No known key found for this signature in database
GPG key ID: 08D5287CC5DDCA0E

View file

@ -109,6 +109,20 @@ in
system.stateVersion = "21.05";
systemd.services.home-assistant-pyscript = {
wantedBy = ["multi-user.target"];
restartIfChanged = true;
path = [ pkgs.rsync ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = "yes";
};
script = ''
mkdir -p /mnt/kyle/infrastructure/home-assistant/home-assistant/pyscript
rsync --chown 403:403 --chmod Du=rwx,Dgo=rx,Fu=rw,Fgo=r -arvc --delete ${secret.pyscript}/. /mnt/kyle/infrastructure/home-assistant/home-assistant/pyscript/
'';
};
boot.kernel.sysctl."fs.inotify.max_user_instances" = 256;
services.udev.extraRules =
let