feat: sync postgres backups to backblaze
Signed-off-by: Lander Van den Bulcke <landervandenbulcke@gmail.com>
This commit is contained in:
parent
1a48fbcfb5
commit
2f8e30aa74
3 changed files with 77 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./disk-config.nix
|
||||
|
|
@ -53,5 +53,45 @@
|
|||
];
|
||||
};
|
||||
|
||||
services.restic.backups = {
|
||||
postgresql = {
|
||||
initialize = true;
|
||||
|
||||
repositoryFile = config.sops.secrets.restic-repository.path;
|
||||
passwordFile = config.sops.secrets.restic-password.path;
|
||||
environmentFile = config.sops.secrets.restic-environment.path;
|
||||
|
||||
timerConfig = {
|
||||
OnCalendar = "03:00";
|
||||
Persistent = true;
|
||||
};
|
||||
|
||||
paths = [
|
||||
"/var/backup/postgresql"
|
||||
];
|
||||
|
||||
pruneOpts = [
|
||||
"--keep-daily 7"
|
||||
"--keep-weekly 5"
|
||||
"--keep-weekly 12"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
sops = {
|
||||
defaultSopsFile = ./secrets.yaml;
|
||||
secrets = {
|
||||
restic-environment = {
|
||||
owner = "root";
|
||||
};
|
||||
restic-password = {
|
||||
owner = "root";
|
||||
};
|
||||
restic-repository = {
|
||||
owner = "root";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
system.stateVersion = "25.05";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue