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 = {