Signed-off-by: Christoph Schmatzler <christoph@schmatzler.com>
This commit is contained in:
2025-08-23 16:37:54 +00:00
parent acd58a2f53
commit 3d127819ea
16 changed files with 252 additions and 633 deletions

View File

@@ -8,6 +8,7 @@
}: {
imports = [
../core.nix
../postgresql.nix
./firewall.nix
./ssh.nix
./adguard.nix

34
modules/postgresql.nix Normal file
View File

@@ -0,0 +1,34 @@
{
config,
lib,
pkgs,
user,
...
}: {
config = lib.mkIf config.services.postgresql.enable {
services.postgresql = {
package = pkgs.postgresql_17;
enableTCPIP = true;
settings.port = 5432;
ensureDatabases = ["postgres"];
ensureUsers = [
{
name = "postgres";
ensureDBOwnership = true;
}
{
name = user;
ensureClauses = {
superuser = true;
createdb = true;
};
}
];
authentication = ''
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
'';
};
};
}