summaryrefslogtreecommitdiff
path: root/os/kay/modules/postgresql.nix
blob: 79d0b12c5230bae650cc075e07405204416d409d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{ config, lib, pkgs, ... }: {
  services.postgresql = {
    enable = true;
    package = with pkgs; postgresql_15;
    authentication = lib.mkForce ''
        #type database DBuser  origin-address auth-method
        # unix socket
        local all      all                    trust
        # ipv4
        host  all      all     127.0.0.1/32   trust
        # ipv6
        host  all      all     ::1/128        trust
    '';

    settings.log_timezone = config.time.timeZone;
  };

  services.prometheus.exporters.postgres = {
    enable = true;
    listenAddress = "127.0.0.1";
  };
}