nixos-config/hosts/defiant/services/postgresql.nix

26 lines
636 B
Nix
Raw Normal View History

2023-10-14 01:22:32 +02:00
{ config, pkgs, lib, ... }:
{
services.postgresql = {
enable = true;
2024-12-01 11:21:55 +01:00
enableTCPIP = true;
authentication = ''
host all all 172.16.0.0/12 md5
'';
2023-10-14 01:22:32 +02:00
};
services.postgresqlBackup = {
2024-03-07 23:45:25 +01:00
enable = true;
location = "/tank/backup/postgresql";
2023-10-14 01:22:32 +02:00
startAt = "*-*-* 03:15:00";
2024-03-07 23:45:25 +01:00
# Each service is registered in its own configuration file
databases = [ ];
2023-10-14 01:22:32 +02:00
};
2024-12-01 11:21:55 +01:00
# Docker containers on this host can reach postgres
networking.firewall.extraCommands = "iptables -A INPUT -p tcp --destination-port 5432 -s 172.16.0.0/12 -j ACCEPT";
2023-10-14 01:22:32 +02:00
environment.systemPackages = [ config.services.postgresql.package ];
}