summary refs log tree commit diff stats
path: root/system/services/restic/default.nix
blob: 3620540d9f20c0adc2ae41c5c79b89a362213597 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{config, ...}: {
  services.restic.backups = let
    srvDir = "/srv";
    boxUser = "u384702-sub2";
  in {
    storagebox = {
      initialize = true;
      paths = [
        srvDir
      ];
      exclude = [
        ".snapshots"
      ];
      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
    };
  };
}