{ config, pkgs, ... }: { services.restic.backups = let homeDir = "/srv/snapshots/home/sils"; srvDir = "${homeDir}/srv"; boxUser = "u384702-sub1"; in { storagebox = { initialize = true; backupPrepareCommand = '' [ -d /srv/snapshots/home ] && ${pkgs.btrfs-progs}/bin/btrfs subvolume delete /srv/snapshots/home; ${pkgs.btrfs-progs}/bin/btrfs subvolume snapshot -r /home /srv/snapshots/home; ''; paths = [ srvDir "${homeDir}/schule" ]; extraBackupArgs = [ "--exclude-if-present .nobackup" # Don't backup directory if it contains a file called ".nobackup" "--verbose" # Spam log ]; passwordFile = config.age.secrets.resticpass.path; extraOptions = [ "rclone.program='ssh -p 23 ${boxUser}@${boxUser}.your-storagebox.de -i ${config.age.secrets.resticssh.path}'" ]; repository = "rclone: "; # There is only one repository served }; }; }