dotfiles/nixos/backups.nix
Cyryl Płotnicki fe4d30f651 nixpkgs-fmt
2021-11-22 19:32:26 +00:00

26 lines
791 B
Nix

{ config, pkgs, ... }:
let
extraArgs = [ "--exclude='.cache'" "--exclude='.rustup'" "--exclude='.cargo'" "--exclude='.local/share'" "--exclude='keybase'" ];
in
{
services = {
restic.backups.home-to-bolty = {
passwordFile = "/etc/nixos/secrets/restic-password-bolty";
paths = [ "/home" ];
repository = "rest:http://bolty:8000/";
timerConfig = { OnCalendar = "hourly"; };
extraBackupArgs = extraArgs;
};
restic.backups.home-to-b2 = {
passwordFile = "/etc/nixos/secrets/restic-password-b2";
paths = [ "/home" ];
repository = "b2:cyplo-restic-${config.networking.hostName}:/";
timerConfig = { OnCalendar = "hourly"; };
extraBackupArgs = extraArgs;
s3CredentialsFile = "/etc/nixos/secrets/b2-env";
};
};
}