diff options
Diffstat (limited to 'hosts/surtr/postgresql.nix')
-rw-r--r-- | hosts/surtr/postgresql.nix | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/hosts/surtr/postgresql.nix b/hosts/surtr/postgresql.nix new file mode 100644 index 00000000..f0cb155b --- /dev/null +++ b/hosts/surtr/postgresql.nix | |||
@@ -0,0 +1,15 @@ | |||
1 | { pkgs, ... }: | ||
2 | { | ||
3 | config = { | ||
4 | services.postgresql = { | ||
5 | enable = true; | ||
6 | package = pkgs.postgresql_14; | ||
7 | initalScript = pkgs.writeText "schema.sql" '' | ||
8 | CREATE DATABASE "matrix-synapse" WITH ENCODING "UTF8" LOCALE "C"; | ||
9 | CREATE USER "matrix-synapse"; | ||
10 | GRANT ALL PRIVILEGES ON DATABASE "matrix-synapse" TO "matrix-synapse"; | ||
11 | GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO "matrix-synapse"; | ||
12 | ''; | ||
13 | }; | ||
14 | }; | ||
15 | } | ||