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

33 lines
760 B
Nix
Raw Normal View History

2023-07-30 19:41:51 +02:00
{ config, pkgs, ... }:
{
2023-11-16 15:08:13 +01:00
age.secrets."borg/passphrase" = {
file = ../../../../secrets/falkenstein/borg/passphrase.age;
};
2023-07-30 19:41:51 +02:00
environment.systemPackages = [ pkgs.borgbackup ];
services.borgmatic = {
enable = true;
settings = {
2023-10-15 16:30:40 +02:00
source_directories = [
"/var/lib"
"/var/log"
2024-05-20 12:25:13 +02:00
"/var/mail"
"/var/sieve"
2023-10-15 16:30:40 +02:00
"/root"
];
2023-07-30 19:41:51 +02:00
2023-10-15 16:30:40 +02:00
repositories = [
{
path = "ssh://root@192.168.42.2/mnt/backup/falkenstein";
2023-10-15 16:30:40 +02:00
label = "nuc";
}
];
2023-11-16 15:08:13 +01:00
encryption_passcommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets."borg/passphrase".path}";
2023-10-28 15:51:25 +02:00
compression = "lz4";
keep_daily = 7;
keep_weekly = 4;
keep_monthly = 12;
keep_yearly = 3;
2023-07-30 19:41:51 +02:00
};
};
}