nixos-config/hosts/falkenstein-1/modules/backup/default.nix

33 lines
723 B
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 = {
2023-10-15 16:30:40 +02:00
source_directories = [
"/var/lib"
"/var/log"
"/root"
];
2023-07-30 19:41:51 +02:00
2023-10-15 16:30:40 +02:00
repositories = [
{
path = "ssh://root@192.168.10.2/mnt/backup/falkenstein";
label = "nuc";
}
];
2023-07-30 19:41:51 +02:00
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;
};
};
};
}