chore[server]: improve backup management

This commit is contained in:
Leon Schwarzäugl 2025-11-27 16:47:41 +01:00
parent 969ae3302d
commit d56d65aac5
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
15 changed files with 1394 additions and 631 deletions

View file

@ -4,6 +4,14 @@ let
in
{
options.swarselmodules.server.restic = lib.mkEnableOption "enable restic backups on server";
options.swarselsystems.server.restic = {
bucketName = lib.mkOption {
type = lib.types.str;
};
paths = lib.mkOption {
type = lib.types.listOf lib.types.str;
};
};
config = lib.mkIf config.swarselmodules.server.restic {
sops = {
@ -26,20 +34,10 @@ in
in
{
backups = {
SwarselWinters = {
"${config.swarselsystems.server.restic.bucketName}" = {
environmentFile = config.sops.templates."restic-env".path;
passwordFile = config.sops.secrets.resticpw.path;
paths = [
"/Vault/data/paperless"
"/Vault/data/koillection"
"/Vault/data/postgresql"
"/Vault/data/firefly-iii"
"/Vault/data/radicale"
"/Vault/data/matrix-synapse"
"/Vault/Eternor/Paperless"
"/Vault/Eternor/Bilder"
"/Vault/Eternor/Immich"
];
inherit (config.swarselsystems.server.restic) paths;
pruneOpts = [
"--keep-daily 3"
"--keep-weekly 2"