{
  services.borgbackup.jobs."borgbase" = {
    paths = [
      # server storage
      "/var/lib/postgresql"
      "/var/lib/mysql"
      "/var/lib/sourcehut"
      "/var/lib/snipe-it"
      # user storage
      "/home"
    ];
    exclude = [
      # remote mounted folders
      "/home/khais/Music"
      "/home/khais/Books"
      # scratch directories
      "/home/*/Downloads"
      "/home/*/.local"
      # cache & trash directories
      "**/*cache"
      "**/*Cache"
      "**/*trash"
      "**/*Trash"
      # already cloud apps
      "**/.mozilla/firefox"
      # build-output directories
      "**/target"
      "**/result"
    ];
    repo = "lni0x30f@lni0x30f.repo.borgbase.com:repo";
    encryption = {
      mode = "repokey-blake2";
      passCommand = "cat /root/borgbackup/passphrase";
    };
    environment.BORG_RSH = "ssh -i /root/borgbackup/ssh_key";
    compression = "auto,lzma";
    startAt = "daily";
    persistentTimer = true;
    preHook = ''
      /bin/sh -c 'while ! /run/current-system/sw/bin/ping -c1 google.com; do sleep 1; done'
    '';
  };
}
