NixOS-Config/nixos/queen/postgres.nix

36 lines
586 B
Nix
Raw Normal View History

2023-11-27 15:06:57 +01:00
{
config,
pkgs,
...
}: {
services.postgresql = {
enable = true;
# Ensure the database, user, and permissions always exist
2023-11-27 15:10:39 +01:00
ensureDatabases = [
"nextcloud"
"onlyoffice"
"akkoma"
"gotosocial"
];
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
}
];
};
}