infrastructure/config/hosts/athame/services/postgres.nix
kat witch 30572115a9 Renamed host beltane to athame.
Migrating from beltane.dork.dev to athame.kittywit.ch. TTL needs to
happen for that specific domain first. For now, temporarily kittywit.ch.
2021-02-11 22:07:32 +00:00

17 lines
528 B
Nix

{ config, pkgs, ... }:
{
services.postgresql.enable = true;
services.postgresql.initialScript = pkgs.writeText "synapse-init.sql" ''
CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD 'synapse';
CREATE DATABASE "matrix-synapse" WITH OWNER "matrix-synapse"
TEMPLATE template0
LC_COLLATE = "C"
LC_CTYPE = "C";
'';
services.postgresql.ensureDatabases = [ "nextcloud" ];
services.postgresql.ensureUsers = [{
name = "nextcloud";
ensurePermissions."DATABASE nextcloud" = "ALL PRIVILEGES";
}];
}