magpie/borgbackup: add periodic backup service

This commit is contained in:
Asmir A 2024-04-05 23:03:01 +02:00
parent 7b07ab31e0
commit 522e5d4fa9
Signed by: asmir
GPG Key ID: 020C42B7A9ABA3E2

View File

@ -232,6 +232,21 @@
}; };
}; };
services.borgbackup.jobs."borgbase" = {
paths = [
"/var/lib/gitea"
];
exclude = [];
repo = "ssh://na9fqv67@na9fqv67.repo.borgbase.com/./repo";
encryption = {
mode = "repokey-blake2";
passCommand = "${pkgs.coreutils-full}/bin/cat ${config.sops.secrets."borgbase_enc_key".path}";
};
environment.BORG_RSH = "${pkgs.openssh}/bin/ssh -i ${config.sops.secrets."borgbase_ssh_key".path}";
compression = "auto,zstd";
startAt = "daily";
};
/* /*
needed for sendmail mail functionality needed for sendmail mail functionality
*/ */
@ -274,6 +289,14 @@
sopsFile = ./secrets/wg_privkey.yaml; sopsFile = ./secrets/wg_privkey.yaml;
}; };
sops.secrets."borgbase_enc_key" = {
sopsFile = ./secrets/borgbase_enc_key.yaml;
};
sops.secrets."borgbase_ssh_key" = {
sopsFile = ./secrets/borgbase_ssh_key.yaml;
};
networking.hostName = "magpie"; networking.hostName = "magpie";
networking.firewall.enable = true; networking.firewall.enable = true;