uberspaceify = repo.libs.uberspace.Uberspaceify(node) files = uberspaceify.files({ f'/home/{node.username}/.bwdownloads/clerie-backup.sh': { "content_type": "download", "source": "https://git.clerie.de/clerie/nixfiles/raw/commit/d17c2855ac0138c5009350d2539954c701df4eec/pkgs/clerie-backup/clerie-backup.sh", "content_hash": "c0b68e6a4979c5ddcaaec10053bd8a1223c0b808", }, f'/home/{node.username}/.bwdownloads/restic.bz2': { "content_type": "download", "source": "https://github.com/restic/restic/releases/download/v0.17.3/restic_0.17.3_linux_amd64.bz2", "content_hash": "cd4336cc86ec4e86decff5c995f08908844120c4", "triggers": [ "action:install_restic", ], }, }) actions = { "clerie_backup_exists": { "command": 'true', "unless": f'[[ -f "/home/{node.username}/bin/clerie-backup" && -x "/home/{node.username}/bin/clerie-backup" ]]', "triggers": [ "action:install_clerie_backup", ], }, "install_clerie_backup": { "command": ( f'sed ' f'-e "s#/etc/clerie-backup#/home/{node.username}/.config/clerie-backup#g" ' f'-e "s#/var/cache/restic#/home/{node.username}/.cache/restic#g" ' f'"/home/{node.username}/.bwdownloads/clerie-backup.sh" ' f'> /home/{node.username}/bin/clerie-backup ' f'&& chmod +x /home/{node.username}/bin/clerie-backup' ), "triggered": True, }, "restic_exists": { "command": 'true', "unless": f'[[ -f "/home/{node.username}/bin/restic" && -x "/home/{node.username}/bin/restic" ]]', "triggers": [ "action:install_restic", ], }, "install_restic": { "command": f'bzip2 -dkc /home/{node.username}/.bwdownloads/restic.bz2 > /home/{node.username}/bin/restic && chmod +x /home/{node.username}/bin/restic', "triggered": True, }, }