forgejo: add postgresBackup

This commit is contained in:
Fiscal Velvet Poet 2023-12-19 22:39:11 +10:00
parent 1d394b6177
commit df0f6a4a41
Signed by: fiscalvelvetpoet
GPG key ID: D8EBFD58B023BD47

View file

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