diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2022-11-10 09:15:50 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2022-11-10 09:15:50 +0100 |
commit | 7e97353075b4acee96488d022e456f80f4f903ed (patch) | |
tree | 570260991c2ecf972b885b45ea4acd76dde0dbd9 /hosts/surtr/postgresql.nix | |
parent | 9d616c8d297db37cc929b711e63f249c3cbe44a5 (diff) | |
download | nixos-7e97353075b4acee96488d022e456f80f4f903ed.tar nixos-7e97353075b4acee96488d022e456f80f4f903ed.tar.gz nixos-7e97353075b4acee96488d022e456f80f4f903ed.tar.bz2 nixos-7e97353075b4acee96488d022e456f80f4f903ed.tar.xz nixos-7e97353075b4acee96488d022e456f80f4f903ed.zip |
surtr: etebase
Diffstat (limited to 'hosts/surtr/postgresql.nix')
-rw-r--r-- | hosts/surtr/postgresql.nix | 13 |
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 | }; |