2023-06-18 17:35:07 -04:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
networking.firewall.allowedTCPPorts = [5432];
|
|
|
|
services.postgresql = {
|
|
|
|
enable = true;
|
|
|
|
enableTCPIP = true;
|
|
|
|
package = pkgs.postgresql_14;
|
|
|
|
settings = {
|
|
|
|
listen_addresses = lib.mkForce "*";
|
2024-04-04 18:15:25 -04:00
|
|
|
port = 5432;
|
2023-10-19 02:46:43 -04:00
|
|
|
max_connections = "300";
|
|
|
|
shared_buffers = "80MB";
|
2023-06-18 17:35:07 -04:00
|
|
|
};
|
|
|
|
authentication = ''
|
|
|
|
local all all trust
|
|
|
|
host replication all 127.0.0.1/32 trust
|
|
|
|
host all all all trust
|
|
|
|
'';
|
|
|
|
ensureUsers = [
|
|
|
|
{
|
|
|
|
name = "hedgedoc";
|
2023-11-24 10:31:22 -05:00
|
|
|
ensureDBOwnership = true;
|
2023-06-18 17:35:07 -04:00
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "forgejo";
|
2023-11-24 10:31:22 -05:00
|
|
|
ensureDBOwnership = true;
|
2023-06-18 17:35:07 -04:00
|
|
|
}
|
2023-06-19 08:18:30 -04:00
|
|
|
{
|
|
|
|
name = "grafana";
|
2023-11-24 10:31:22 -05:00
|
|
|
ensureDBOwnership = true;
|
2023-06-19 08:18:30 -04:00
|
|
|
}
|
2023-06-19 19:04:38 -04:00
|
|
|
{
|
|
|
|
name = "authelia";
|
2023-11-24 10:31:22 -05:00
|
|
|
ensureDBOwnership = true;
|
2023-06-19 19:04:38 -04:00
|
|
|
}
|
2023-09-09 13:12:47 -04:00
|
|
|
{
|
|
|
|
name = "vaultwarden";
|
2023-11-24 10:31:22 -05:00
|
|
|
ensureDBOwnership = true;
|
2023-09-09 13:12:47 -04:00
|
|
|
}
|
2024-01-04 14:41:50 -05:00
|
|
|
{
|
|
|
|
name = "attic";
|
|
|
|
ensureDBOwnership = true;
|
|
|
|
}
|
2024-01-25 22:59:08 -05:00
|
|
|
{
|
|
|
|
name = "miniflux";
|
|
|
|
ensureDBOwnership = true;
|
|
|
|
}
|
2024-02-05 21:25:45 -05:00
|
|
|
{
|
|
|
|
name = "atuin";
|
|
|
|
ensureDBOwnership = true;
|
|
|
|
}
|
2024-11-12 16:35:58 -05:00
|
|
|
{
|
|
|
|
name = "ec";
|
|
|
|
ensureDBOwnership = true;
|
|
|
|
}
|
2023-06-18 17:35:07 -04:00
|
|
|
];
|
|
|
|
ensureDatabases = [
|
|
|
|
"forgejo"
|
|
|
|
"hedgedoc"
|
2023-06-19 08:18:30 -04:00
|
|
|
"grafana"
|
2023-06-19 19:04:38 -04:00
|
|
|
"authelia"
|
2023-09-09 13:12:47 -04:00
|
|
|
"vaultwarden"
|
2024-01-04 14:41:50 -05:00
|
|
|
"attic"
|
2024-01-25 22:59:08 -05:00
|
|
|
"miniflux"
|
2024-02-05 21:25:45 -05:00
|
|
|
"atuin"
|
2024-11-12 16:35:58 -05:00
|
|
|
"ec"
|
2023-06-18 17:35:07 -04:00
|
|
|
];
|
|
|
|
};
|
2023-12-31 12:51:49 -05:00
|
|
|
services.postgresqlBackup = {
|
|
|
|
enable = true;
|
2024-02-05 21:25:45 -05:00
|
|
|
databases = [
|
|
|
|
"forgejo"
|
|
|
|
"hedgedoc"
|
|
|
|
"grafana"
|
|
|
|
"authelia"
|
|
|
|
"vaultwarden"
|
|
|
|
"attic"
|
|
|
|
"miniflux"
|
|
|
|
"atuin"
|
|
|
|
];
|
2023-12-31 12:51:49 -05:00
|
|
|
compression = "zstd";
|
|
|
|
compressionLevel = 4;
|
2023-12-31 13:31:12 -05:00
|
|
|
startAt = "*-*-* 23:00:00";
|
2023-12-31 12:51:49 -05:00
|
|
|
};
|
2023-06-18 17:35:07 -04:00
|
|
|
}
|