NixOS-Config/nixos/queen/postgres.nix
Lillian-Violet 8526e4520c This mayhaps
2023-12-21 20:53:49 +01:00

42 lines
826 B
Nix

{
config,
pkgs,
...
}: {
#Define postgres here so this is the only place to update its version
postgresPackage = postgresql_15.withPackages (pp: [
# pp.plv8
]);
services.postgresql = {
# https://nixos.org/manual/nixos/stable/#module-postgresql
package = pkgs.${postgresPackage};
enable = true;
# Ensure the database, user, and ownership is set
ensureDatabases = [
"nextcloud"
"onlyoffice"
"akkoma"
"gotosocial"
];
ensureUsers = [
{
name = "nextcloud";
ensureDBOwnership = true;
}
{
name = "onlyoffice";
ensureDBOwnership = true;
}
{
name = "akkoma";
ensureDBOwnership = true;
}
{
name = "gotosocial";
ensureDBOwnership = true;
}
];
};
}