summaryrefslogtreecommitdiff
path: root/hosts/surtr/postgresql.nix
blob: f0cb155b5cbae0dc555e994b3668eb6806e90b4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{ pkgs, ... }:
{
  config = {
    services.postgresql = {
      enable = true;
      package = pkgs.postgresql_14;
      initalScript = pkgs.writeText "schema.sql" ''
        CREATE DATABASE "matrix-synapse" WITH ENCODING "UTF8" LOCALE "C";
        CREATE USER "matrix-synapse";
        GRANT ALL PRIVILEGES ON DATABASE "matrix-synapse" TO "matrix-synapse";
        GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO "matrix-synapse";
      '';
    };
  };
}