add postgres

This commit is contained in:
Lyes Saadi 2025-10-15 19:41:08 +02:00
parent 906bcfc141
commit a85f93b630
Signed by: lyes
GPG key ID: 55A1D803917CF39A
2 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,26 @@
{ pkgs, lib, ... }:
{
services.postgresql = {
enable = true;
package = lib.mkDefault pkgs.postgresql_18;
authentication = pkgs.lib.mkOverride 10 ''
#type database DBuser IP address auth-method
local all all trust
host all all 127.0.0.1/32 md5
'';
ensureDatabases = [
"giovanni"
];
ensureUsers = [
{
name = "giovanni";
ensureDBOwnership = true;
}
];
};
}