From e4063869d607fdde69fbed65ec000091b221c0a8 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Thu, 4 May 2023 18:16:38 +0200 Subject: [PATCH] configure postgres auth --- modules/data-hoarder/postgres.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/data-hoarder/postgres.nix b/modules/data-hoarder/postgres.nix index a6a1c4f..6e3b1e8 100644 --- a/modules/data-hoarder/postgres.nix +++ b/modules/data-hoarder/postgres.nix @@ -1,9 +1,19 @@ -{ lib, pkgs, config, inputs, ... }: { +{ lib, pkgs, config, inputs, self, ... }: { services.postgresql = { enable = true; enableTCPIP = true; port = 5432; + authentication = + let + senpai-ip = self.nixosConfigurations.notice-me-senpai.config.deployment-TLMS.net.wg.addr4; + in + pkgs.lib.mkOverride 10 '' + local all all trust + host all all 127.0.0.1/32 trust + host all all ::1/128 trust + host tlms grafana ${senpai-ip}/32 trust + ''; package = pkgs.postgresql_14; ensureDatabases = [ "tlms" ]; ensureUsers = [