summaryrefslogtreecommitdiff
path: root/hosts/surtr/postgresql.nix
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/surtr/postgresql.nix')
-rw-r--r--hosts/surtr/postgresql.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/hosts/surtr/postgresql.nix b/hosts/surtr/postgresql.nix
index 7013ae97..c10c5084 100644
--- a/hosts/surtr/postgresql.nix
+++ b/hosts/surtr/postgresql.nix
@@ -24,6 +24,7 @@ in {
24 psql postgres postgres -eXf ${pkgs.writeText "schema.sql" '' 24 psql postgres postgres -eXf ${pkgs.writeText "schema.sql" ''
25 CREATE DATABASE "matrix-synapse" WITH TEMPLATE "template0" ENCODING "UTF8" LOCALE "C"; 25 CREATE DATABASE "matrix-synapse" WITH TEMPLATE "template0" ENCODING "UTF8" LOCALE "C";
26 CREATE DATABASE "email" WITH TEMPLATE "template0" ENCODING "UTF8" LOCALE "C"; 26 CREATE DATABASE "email" WITH TEMPLATE "template0" ENCODING "UTF8" LOCALE "C";
27 CREATE DATABASE "etebase" WITH TEMPLATE "template0" ENCODING "UTF8" LOCALE "C";
27 ''} 28 ''}
28 29
29 psql matrix-synapse postgres -eXf ${pkgs.writeText "matrix-synapse.sql" '' 30 psql matrix-synapse postgres -eXf ${pkgs.writeText "matrix-synapse.sql" ''
@@ -153,6 +154,18 @@ in {
153 GRANT SELECT ON ALL TABLES IN SCHEMA public TO "postfix-ccert-sender-policy"; 154 GRANT SELECT ON ALL TABLES IN SCHEMA public TO "postfix-ccert-sender-policy";
154 COMMIT; 155 COMMIT;
155 ''} 156 ''}
157
158 psql etebase postgres -eXf ${pkgs.writeText "etebase.sql" ''
159 \i ${versioning + "/install.versioning.sql"}
160
161 BEGIN;
162 SELECT _v.register_patch('000-user', null, null);
163
164 CREATE USER "etebase";
165 GRANT ALL PRIVILEGES ON DATABASE "etebase" TO "etebase";
166 GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO "etebase";
167 COMMIT;
168 ''}
156 ''; 169 '';
157 }; 170 };
158 }; 171 };