mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2025-04-29 18:08:29 +02:00
configured backups
This commit is contained in:
parent
60e1f3c3d0
commit
b48fa4e383
25 changed files with 217 additions and 92 deletions
32
hosts/falkenstein-1/modules/backup/default.nix
Normal file
32
hosts/falkenstein-1/modules/backup/default.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
sops.secrets."borg/passphrase" = { };
|
||||
environment.systemPackages = [ pkgs.borgbackup ];
|
||||
services.borgmatic = {
|
||||
enable = true;
|
||||
settings = {
|
||||
location = {
|
||||
source_directories = [
|
||||
"/var/lib"
|
||||
"/var/log"
|
||||
"/etc/crowdsec"
|
||||
"/root"
|
||||
];
|
||||
|
||||
repositories = [
|
||||
"ssh://root@192.168.10.2/mnt/backup/falkenstein"
|
||||
];
|
||||
};
|
||||
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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue