snowflake/hosts/arashi/services/postgresql.nix
notohh 193f2480d7
Some checks failed
ci/woodpecker/cron/flake-lock-update Pipeline failed
flake.nix: update
license: update

pkgs: remove scls

nix: update inputs and insecure pkgs

tsuki: init gaming file

blocky: update blocklist

pgres: add dbs

home: update themes

programs: init opencomposite

media: remove spotify-player

helix: update theme and scls

tsuki: remove stylix

overlays: set chatterino tag to null
2025-01-12 20:52:09 -05:00

94 lines
1.7 KiB
Nix

{
pkgs,
lib,
...
}: {
networking.firewall.allowedTCPPorts = [5432];
services.postgresql = {
enable = true;
enableTCPIP = true;
package = pkgs.postgresql_14;
settings = {
listen_addresses = lib.mkForce "*";
port = 5432;
max_connections = "300";
shared_buffers = "80MB";
};
authentication = ''
local all all trust
host replication all 127.0.0.1/32 trust
host all all all trust
'';
ensureUsers = [
{
name = "hedgedoc";
ensureDBOwnership = true;
}
{
name = "forgejo";
ensureDBOwnership = true;
}
{
name = "grafana";
ensureDBOwnership = true;
}
{
name = "authelia";
ensureDBOwnership = true;
}
{
name = "vaultwarden";
ensureDBOwnership = true;
}
{
name = "attic";
ensureDBOwnership = true;
}
{
name = "miniflux";
ensureDBOwnership = true;
}
{
name = "atuin";
ensureDBOwnership = true;
}
{
name = "ec";
ensureDBOwnership = true;
}
{
name = "botoh";
ensureDBOwnership = true;
}
];
ensureDatabases = [
"forgejo"
"hedgedoc"
"grafana"
"authelia"
"vaultwarden"
"attic"
"miniflux"
"atuin"
"ec"
"botoh"
];
};
services.postgresqlBackup = {
enable = true;
databases = [
"forgejo"
"hedgedoc"
"grafana"
"authelia"
"vaultwarden"
"attic"
"miniflux"
"atuin"
"botoh"
];
compression = "zstd";
compressionLevel = 4;
startAt = "*-*-* 23:00:00";
};
}