snowflake/hosts/arashi/services/postgresql.nix

57 lines
1.2 KiB
Nix
Raw Normal View History

2023-06-18 17:35:07 -04:00
{
pkgs,
lib,
...
}: {
networking.firewall.allowedTCPPorts = [5432];
services.postgresql = {
enable = true;
enableTCPIP = true;
package = pkgs.postgresql_14;
port = 5432;
settings = {
listen_addresses = lib.mkForce "*";
};
authentication = ''
local all all trust
host replication all 127.0.0.1/32 trust
host all all all trust
'';
ensureUsers = [
{
name = "postgres";
ensurePermissions = {
"ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES";
};
}
{
name = "hedgedoc";
ensurePermissions."DATABASE hedgedoc" = "ALL PRIVILEGES";
}
{
name = "forgejo";
ensurePermissions."DATABASE forgejo" = "ALL PRIVILEGES";
}
2023-06-19 08:18:30 -04:00
{
name = "grafana";
ensurePermissions."DATABASE grafana" = "ALL PRIVILEGES";
}
2023-06-19 19:04:38 -04:00
{
name = "authelia";
ensurePermissions."DATABASE authelia" = "ALL PRIVILEGES";
}
2023-09-09 13:12:47 -04:00
{
name = "vaultwarden";
ensurePermissions."DATABASE vaultwarden" = "ALL PRIVILEGES";
}
2023-06-18 17:35:07 -04:00
];
ensureDatabases = [
"forgejo"
"hedgedoc"
2023-06-19 08:18:30 -04:00
"grafana"
2023-06-19 19:04:38 -04:00
"authelia"
2023-09-09 13:12:47 -04:00
"vaultwarden"
2023-06-18 17:35:07 -04:00
];
};
}