From 522c8a27dbde0d337c40aa05597c43df05f5ff8f Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 24 Feb 2022 20:59:41 +0100 Subject: surtr: synapse.li: ... --- hosts/surtr/postgres.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 hosts/surtr/postgres.nix (limited to 'hosts/surtr/postgres.nix') 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 @@ +{ pkgs, ... }: +{ + config = { + services.postgresql = { + enable = true; + package = pkgs.postgresql_14; + ensureDatabases = [ + "matrix-synapse" + ]; + ensureUsers = [ + { name = "matrix-synapse"; + ensurePermissions = { + "DATABASE \"matrix-synapse\"" = "ALL PRIVILEGES"; + "ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES"; + }; + } + ]; + }; + }; +} -- cgit v1.2.3