~cyplo/dotfiles

ref: 0f34b9d1bf61e8be3e61351814603e01c8bf42cd dotfiles/nixos/backups.nix -rw-r--r-- 785 bytes
0f34b9d1 — Cyryl Płotnicki upgrade rust-analyzer 5 months ago
                                                                                
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, pkgs, ... }:
let
  extraArgs = [ "--exclude='.cache'" "--exclude='.rustup'" "--exclude='.cargo'" "--exclude '.local/share'" ];
in
  {

    services = {
      restic.backups.home-to-brix = {
        passwordFile = "/etc/nixos/secrets/restic-password-brix";
        paths = [ "/home" ];
        repository = "rest:http://brix.vpn:8000/";
        timerConfig = { OnCalendar = "hourly"; };
        extraBackupArgs = extraArgs;
      };

      restic.backups.home-to-b2 = {
        passwordFile = "/etc/nixos/secrets/restic-password-b2";
        paths = [ "/home" ];
        repository = "b2:cyplo-restic-foureighty:/";
        timerConfig = { OnCalendar = "hourly"; };
        extraBackupArgs = extraArgs;
        s3CredentialsFile = "/etc/nixos/secrets/b2";
      };
    };
  }