From 722ed550c851695645760367053724a68a6616ca Mon Sep 17 00:00:00 2001 From: Kabbone Date: Wed, 28 Dec 2022 11:07:40 +0100 Subject: [PATCH] services: create database in init --- modules/services/server/postgresql.nix | 18 +++++++----------- secrets/services/postgresql/initScript.age | Bin 1746 -> 2442 bytes 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/modules/services/server/postgresql.nix b/modules/services/server/postgresql.nix index 2de40ac..ef71d04 100644 --- a/modules/services/server/postgresql.nix +++ b/modules/services/server/postgresql.nix @@ -22,23 +22,19 @@ }; authentication = pkgs.lib.mkOverride 14 '' local all postgres peer - local giteadb gitea scram-sha-256 - local nextclouddb nextcloud scram-sha-256 - local synapsedb synapse scram-sha-256 - local whatsappdb mautrixwa scram-sha-256 - local telegramdb mautrixtele scram-sha-256 - local signaldb mautrixsignal scram-sha-256 - local keycloakdb keycloak scram-sha-256 + host giteadb gitea localhost scram-sha-256 + host nextclouddb nextcloud localhost scram-sha-256 + host synapsedb synapse localhost scram-sha-256 + host whatsappdb mautrixwa localhost scram-sha-256 + host telegramdb mautrixtele localhost scram-sha-256 + host signaldb mautrixsignal localhost scram-sha-256 + host keycloakdb keycloak localhost scram-sha-256 ''; initialScript = config.age.secrets."services/postgresql/initScript.sql".path; ensureDatabases = [ - "giteadb" - "nextclouddb" - "synapsedb" "whatsappdb" "telegramdb" "signaldb" - "keycloakdb" ]; ensureUsers = [ { diff --git a/secrets/services/postgresql/initScript.age b/secrets/services/postgresql/initScript.age index 22a77e3031e35a7d05f81c3f4935628179695d78..1fb9eb56c37c35004fa72863dc75b42e8898eae1 100644 GIT binary patch literal 2442 zcmX|=iC0vG0*3|RfRia28Hyr=kT^`UZ=l$nePd?soqbgD&UWu?ch-AnQL}Q*3@!EL z7MX@bNam7&s0cm57g9bGdy4O*poL2Y#WPaSSDo|TU+{gubG{#pI4Mrd9!>*5h)u-emOZK!eCY1tlUp;nyjsmJs+qS~vpd z8>1d+5F|M~5m_7+g?;h}9a4Lf7B(FRI2s3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