nixos-config/hosts/thinkpad/modules/backup/default.nix

47 lines
1.1 KiB
Nix
Raw Normal View History

2023-07-30 19:41:51 +02:00
{ config, pkgs, ... }:
{
sops.secrets."borg/passphrase" = { };
environment.systemPackages = [ pkgs.borgbackup ];
services.borgmatic = {
enable = true;
settings = {
location = {
source_directories = [
"/var/lib"
"/var/log"
"/nix/persist"
"/home"
2023-07-31 14:12:10 +02:00
"/etc/secureboot"
2023-07-30 19:41:51 +02:00
];
repositories = [
"ssh://root@192.168.10.2/mnt/backup/thinkpad"
];
exclude_patterns = [
"/home/*/.cache"
"/home/*/.zcomp*"
"/home/*/.zcomp*"
2023-08-02 18:04:26 +02:00
"/home/*/.gradle*"
"/home/*/.java*"
"/home/*/.m2*"
"/home/*/.wine*"
"/home/*/.mypy_cache*"
"/home/*/.local/share"
"/home/*/.local/share"
2023-07-30 19:41:51 +02:00
"/home/*/Linux/Isos"
];
};
storage = {
encryption_passcommand = "${pkgs.coreutils}/bin/cat ${config.sops.secrets."borg/passphrase".path}";
compression = "lz4";
};
retention = {
keep_daily = 7;
keep_weekly = 4;
keep_monthly = 12;
keep_yearly = 3;
};
};
};
}