From df0f6a4a417471c41cc00687d1e9344c27e593ed Mon Sep 17 00:00:00 2001 From: Fiscal Velvet Poet Date: Tue, 19 Dec 2023 22:39:11 +1000 Subject: [PATCH] forgejo: add postgresBackup --- profiles/reciproka-forgejo.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/profiles/reciproka-forgejo.nix b/profiles/reciproka-forgejo.nix index 7140f06..8e6729c 100644 --- a/profiles/reciproka-forgejo.nix +++ b/profiles/reciproka-forgejo.nix @@ -67,7 +67,6 @@ in { services.postgresql = { enable = true; # Ensure postgresql is enabled - package = pkgs.postgresql; authentication = '' local gitea all ident map=gitea-users ''; @@ -80,9 +79,21 @@ in { ensureUsers = [ { name = "gitea"; # Ensure the database user persists - ensureDBOwnership = true; + ensurePermissions = { + # Ensure the database permissions persist + "DATABASE gitea" = "ALL PRIVILEGES"; + "ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES"; + }; } ]; + package = pkgs.postgresql_16; + }; + + services.postgresqlBackup = { + enable = true; + compression = "zstd"; + databases = ["gitea"]; + startAt = "*-*-* 15:00:00"; }; services.nginx = {