2024-10-28 00:17:05 +01:00
|
|
|
{pkgs, ...}: {
|
2023-11-27 15:06:57 +01:00
|
|
|
services.postgresql = {
|
2023-12-18 21:38:17 +01:00
|
|
|
# https://nixos.org/manual/nixos/stable/#module-postgresql
|
2023-12-21 20:57:21 +01:00
|
|
|
package = pkgs.postgresql_16;
|
2023-11-27 15:06:57 +01:00
|
|
|
enable = true;
|
|
|
|
|
2023-12-18 22:17:37 +01:00
|
|
|
# Ensure the database, user, and ownership is set
|
2023-11-27 15:10:39 +01:00
|
|
|
ensureDatabases = [
|
|
|
|
"nextcloud"
|
|
|
|
"onlyoffice"
|
|
|
|
"akkoma"
|
|
|
|
"gotosocial"
|
2023-12-26 16:35:33 +01:00
|
|
|
"gitea"
|
2023-11-27 15:10:39 +01:00
|
|
|
];
|
2023-11-27 15:06:57 +01:00
|
|
|
ensureUsers = [
|
|
|
|
{
|
|
|
|
name = "nextcloud";
|
2023-12-17 21:25:08 +01:00
|
|
|
ensureDBOwnership = true;
|
2023-11-27 15:06:57 +01:00
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "onlyoffice";
|
2023-12-17 21:25:08 +01:00
|
|
|
ensureDBOwnership = true;
|
2023-11-27 15:06:57 +01:00
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "akkoma";
|
2023-12-17 21:25:08 +01:00
|
|
|
ensureDBOwnership = true;
|
2023-11-27 15:06:57 +01:00
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "gotosocial";
|
2023-12-17 21:25:08 +01:00
|
|
|
ensureDBOwnership = true;
|
2023-11-27 15:06:57 +01:00
|
|
|
}
|
2023-12-26 16:35:33 +01:00
|
|
|
{
|
|
|
|
name = "gitea";
|
|
|
|
ensureDBOwnership = true;
|
|
|
|
}
|
2023-11-27 15:06:57 +01:00
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|