forgejo: add postgresBackup
This commit is contained in:
parent
1d394b6177
commit
df0f6a4a41
|
@ -67,7 +67,6 @@ in {
|
||||||
|
|
||||||
services.postgresql = {
|
services.postgresql = {
|
||||||
enable = true; # Ensure postgresql is enabled
|
enable = true; # Ensure postgresql is enabled
|
||||||
package = pkgs.postgresql;
|
|
||||||
authentication = ''
|
authentication = ''
|
||||||
local gitea all ident map=gitea-users
|
local gitea all ident map=gitea-users
|
||||||
'';
|
'';
|
||||||
|
@ -80,9 +79,21 @@ in {
|
||||||
ensureUsers = [
|
ensureUsers = [
|
||||||
{
|
{
|
||||||
name = "gitea"; # Ensure the database user persists
|
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 = {
|
services.nginx = {
|
||||||
|
|
Loading…
Reference in a new issue