summaryrefslogtreecommitdiff
path: root/os/kay/modules/internal/postgresql.nix
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2025-10-17 08:31:18 +0530
committersinanmohd <sinan@sinanmohd.com>2025-10-17 08:45:14 +0530
commit84c39b405972516a9be2e8be8729097f8691050f (patch)
tree5a63186f3004e36a0f7560ee90ef358bd3662aa9 /os/kay/modules/internal/postgresql.nix
parent5fd8a7084e907f4c1b4c2c86cfd69f622b4c294a (diff)
chore(os/kay): refactor
Diffstat (limited to 'os/kay/modules/internal/postgresql.nix')
-rw-r--r--os/kay/modules/internal/postgresql.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/os/kay/modules/internal/postgresql.nix b/os/kay/modules/internal/postgresql.nix
new file mode 100644
index 0000000..6ba5398
--- /dev/null
+++ b/os/kay/modules/internal/postgresql.nix
@@ -0,0 +1,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";
+ };
+}