From d211fb72c406e2d61dc43d531ac4ac7b7c6babca Mon Sep 17 00:00:00 2001 From: Kabbone Date: Wed, 28 Dec 2022 11:51:37 +0100 Subject: [PATCH] services: move all user operations in initscript --- modules/services/server/postgresql.nix | 44 --------------------- secrets/services/postgresql/initScript.age | Bin 2971 -> 2991 bytes 2 files changed, 44 deletions(-) diff --git a/modules/services/server/postgresql.nix b/modules/services/server/postgresql.nix index e08d452..bc6593c 100644 --- a/modules/services/server/postgresql.nix +++ b/modules/services/server/postgresql.nix @@ -31,50 +31,6 @@ host keycloakdb keycloak localhost scram-sha-256 ''; initialScript = config.age.secrets."services/postgresql/initScript.sql".path; - ensureUsers = [ - { - name = "gitea"; - ensurePermissions = { - "DATABASE giteadb" = "ALL PRIVILEGES"; - }; - } - { - name = "nextcloud"; - ensurePermissions = { - "DATABASE nextclouddb" = "ALL PRIVILEGES"; - }; - } - { - name = "synapse"; - ensurePermissions = { - "DATABASE synapsedb" = "ALL PRIVILEGES"; - }; - } - { - name = "mautrixwa"; - ensurePermissions = { - "DATABASE whatsappdb" = "ALL PRIVILEGES"; - }; - } - { - name = "mautrixtele"; - ensurePermissions = { - "DATABASE telegramdb" = "ALL PRIVILEGES"; - }; - } - { - name = "mautrixsignal"; - ensurePermissions = { - "DATABASE signaldb" = "ALL PRIVILEGES"; - }; - } - { - name = "keycloak"; - ensurePermissions = { - "DATABASE keycloakdb" = "ALL PRIVILEGES"; - }; - } - ]; }; services.postgresqlBackup.enable = true; diff --git a/secrets/services/postgresql/initScript.age b/secrets/services/postgresql/initScript.age index 60736fc8f702afca23b256fa901b82e233c00273..9f05c38d0d87d2708dc836b12ee69933258c3a80 100644 GIT binary patch literal 2991 zcmY+CYg|kT1BVMq(^AN~t(EIqQ)bRgXD(8iGxwP@_s%qvOXhm!exGS(h|N#fgtfU; z?yXB9i!Bz(s}d3^Y?9k98!9S~xeALum1+z)(h)9REHqMSK_XwDz(gD#uaaiBBLAbg+^Sf) z$HaC>Fl-RZahcKsA|44=TX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