dotfiles/nixos/backups.nix
Cyryl Płotnicki 3d6dd759c4 nixfmt
2022-03-10 12:25:23 +00:00

25 lines
744 B
Nix

{ config, pkgs, ... }:
let
extraArgs =
[ "--exclude='.cache'" "--exclude='.rustup'" "--exclude='.cargo'" ];
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;
environmentFile = "/etc/nixos/secrets/b2-env";
};
};
}