dotfiles/nixos/backups.nix

26 lines
828 B
Nix
Raw Normal View History

2020-06-04 17:51:26 +01:00
{ config, pkgs, ... }:
2020-07-12 08:53:40 +01:00
let
extraArgs = [ "--exclude='.cache'" "--exclude='.rustup'" "--exclude='.cargo'" "--exclude='.local/share'" "--exclude='keybase'"];
2020-07-12 08:53:40 +01:00
in
{
2020-06-04 17:51:26 +01:00
2020-07-12 08:53:40 +01:00
services = {
2021-10-01 10:22:46 +01:00
restic.backups.home-to-bolty = {
passwordFile = "/etc/nixos/secrets/restic-password-bolty";
2020-07-12 08:53:40 +01:00
paths = [ "/home" ];
2021-10-01 10:22:46 +01:00
repository = "rest:http://bolty:8000/";
2020-07-12 08:53:40 +01:00
timerConfig = { OnCalendar = "hourly"; };
extraBackupArgs = extraArgs;
};
2020-06-04 17:51:26 +01:00
2020-07-12 08:53:40 +01:00
restic.backups.home-to-b2 = {
passwordFile = "/etc/nixos/secrets/restic-password-b2";
paths = [ "/home" ];
2021-06-26 23:18:45 +01:00
repository = "b2:cyplo-restic-${config.networking.hostName}:/";
2020-07-12 08:53:40 +01:00
timerConfig = { OnCalendar = "hourly"; };
extraBackupArgs = extraArgs;
2021-06-26 23:18:45 +01:00
s3CredentialsFile = "/etc/nixos/secrets/b2-env";
2020-07-12 08:53:40 +01:00
};
2020-06-04 17:51:26 +01:00
};
2020-07-12 08:53:40 +01:00
}