diff options
Diffstat (limited to 'hosts/surtr/postgres.nix')
-rw-r--r-- | hosts/surtr/postgres.nix | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/hosts/surtr/postgres.nix b/hosts/surtr/postgres.nix new file mode 100644 index 00000000..e8ea73be --- /dev/null +++ b/hosts/surtr/postgres.nix | |||
@@ -0,0 +1,20 @@ | |||
1 | { pkgs, ... }: | ||
2 | { | ||
3 | config = { | ||
4 | services.postgresql = { | ||
5 | enable = true; | ||
6 | package = pkgs.postgresql_14; | ||
7 | ensureDatabases = [ | ||
8 | "matrix-synapse" | ||
9 | ]; | ||
10 | ensureUsers = [ | ||
11 | { name = "matrix-synapse"; | ||
12 | ensurePermissions = { | ||
13 | "DATABASE \"matrix-synapse\"" = "ALL PRIVILEGES"; | ||
14 | "ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES"; | ||
15 | }; | ||
16 | } | ||
17 | ]; | ||
18 | }; | ||
19 | }; | ||
20 | } | ||