mirror of
https://forge.katzen.cafe/katzen-cafe/katzen-cafe.git
synced 2024-11-22 14:04:41 +01:00
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";
|
||
|
};
|
||
|
};
|
||
|
}
|