From 8e09451dee92ef6be905e36564d6c97a59972558 Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Mon, 25 Sep 2023 13:06:06 -0500 Subject: [PATCH] allow root to log in as any user locally --- flake.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index d1ac79d..9a375bc 100644 --- a/flake.nix +++ b/flake.nix @@ -537,10 +537,18 @@ hostnossl replication all all reject hostssl replication all all scram-sha-256 ''; - identFile = pkgs.writeTextDir "pg_ident.conf" '' - default root postgres - default postgres postgres - ''; + identFile = pkgs.writeTextDir "pg_ident.conf" ( + '' + default root postgres + default postgres postgres + '' + (lib.strings.concatStringsSep "\n" + ( + map + (user: "default root ${user.username}") + cfg.users + ) + ) + ); archiveCommand = "${pgbackrest}/bin/pgbackrest archive-push %p"; settings = { bgwriter_flush_after = "512kB";