katzen-cafe/modules/containers/postgres.nix

33 lines
636 B
Nix
Raw Normal View History

2023-04-26 21:25:04 +00:00
{ pkgs, ... }:
{
containers.postgres = {
autoStart = true;
localAddress = "127.0.0.1";
bindMounts = {
"/var/lib/postgresql" = {
hostPath = "/postgres";
isReadOnly = false;
};
};
config = { config, pkgs, ... }: {
services.postgresql = {
enable = true;
ensureUsers = [
{
name = "keycloak";
ensurePermissions = {
"DATABASE \"nextcloud\"" = "ALL PRIVILEGES";
};
}
];
ensureDatabases = [
"keycloak"
];
};
system.stateVersion = "22.11";
};
};
}