forked from katzen-cafe/katzen-cafe
33 lines
636 B
Nix
33 lines
636 B
Nix
|
{ 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";
|
||
|
};
|
||
|
};
|
||
|
}
|