hosts/athame: PostgreSQL moved to service definitions

This commit is contained in:
kat witch 2021-04-27 22:27:13 +01:00
parent 4058860ec6
commit fbef9f2cd8
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
3 changed files with 14 additions and 22 deletions

View file

@ -1,15 +1,17 @@
{ config, lib, pkgs, profiles, ... }:
with lib;
{
imports = [
./hw.nix
# profiles
profiles.kat
# host-specific services
./postgres.nix
./virtualhosts.nix
./fail2ban.nix
# services
# services
../../../services/fail2ban.nix
../../../services/postgres.nix
../../../services/nginx.nix
../../../services/mail.nix
../../../services/asterisk.nix

View file

@ -1,17 +0,0 @@
{ 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";
}];
}

View file

@ -1,8 +1,15 @@
{ config, pkgs, witch, ... }:
{
environment.systemPackages =
[ pkgs.arc.pkgs.mx-puppet-discord pkgs.mautrix-whatsapp ];
environment.systemPackages = [ pkgs.mx-puppet-discord pkgs.mautrix-whatsapp ];
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.matrix-synapse = {
enable = true;