summaryrefslogtreecommitdiff
path: root/os/kay/modules/postgresql.nix
blob: 6ba5398f7e9d389e2eaa9288f7424cec1f82ec40 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{
  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";
  };
}