From 36ed3c73b5900f4d508fff2fbffc76d99ac435a5 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Sat, 20 Jul 2024 20:15:13 +0530 Subject: [PATCH] wynne: enable postgresql --- hosts/wynne/services/apps/default.nix | 5 ++++- hosts/wynne/services/apps/postgresql.nix | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 hosts/wynne/services/apps/postgresql.nix diff --git a/hosts/wynne/services/apps/default.nix b/hosts/wynne/services/apps/default.nix index e2ea410..218548e 100644 --- a/hosts/wynne/services/apps/default.nix +++ b/hosts/wynne/services/apps/default.nix @@ -1,3 +1,6 @@ _: { - imports = [ ../../../shared/prometheus-exporters.nix ]; + imports = [ + ./postgresql.nix + ../../../shared/prometheus-exporters.nix + ]; } diff --git a/hosts/wynne/services/apps/postgresql.nix b/hosts/wynne/services/apps/postgresql.nix new file mode 100644 index 0000000..f3f864c --- /dev/null +++ b/hosts/wynne/services/apps/postgresql.nix @@ -0,0 +1,18 @@ +{ config, pkgs, ... }: { + services = { + postgresql = { + enable = true; + dataDir = "/mnt/data/postgresql/${config.services.postgresql.package.psqlSchema}"; + authentication = pkgs.lib.mkOverride 10 '' + local all all trust + host all all 127.0.0.1/8 trust + host all all ::1/128 trust + host all all 10.10.10.0/24 trust + host all all fd7c:585c:c4ae::0/64 trust + ''; + ensureDatabases = [ ]; + ensureUsers = [ ]; + }; + }; + systemd.services.postgresql.unitConfig.RequiresMountsFor = [ "/mnt/data" ]; +}