From c5734ee3086a0503480f48bbd746e65242253d3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sat, 28 Oct 2023 02:21:34 +0200 Subject: [PATCH] feat: matrix initial commit --- hosts/nachtigall/default.nix | 9 +++---- hosts/nachtigall/matrix.nix | 35 +++++++++++++++++++++++++++ hosts/nachtigall/mautrix-telegram.nix | 12 +++++++++ 3 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 hosts/nachtigall/matrix.nix create mode 100644 hosts/nachtigall/mautrix-telegram.nix diff --git a/hosts/nachtigall/default.nix b/hosts/nachtigall/default.nix index 4430aa0..5df7892 100644 --- a/hosts/nachtigall/default.nix +++ b/hosts/nachtigall/default.nix @@ -1,10 +1,9 @@ { config, pkgs, ... }: - { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; + imports = [ + ./hardware-configuration.nix + ./matrix.nix + ]; # Use GRUB2 as the boot loader. # We don't use systemd-boot because Hetzner uses BIOS legacy boot. diff --git a/hosts/nachtigall/matrix.nix b/hosts/nachtigall/matrix.nix new file mode 100644 index 0000000..e903f3e --- /dev/null +++ b/hosts/nachtigall/matrix.nix @@ -0,0 +1,35 @@ +{ config, pkgs, ... }: +{ + + services.caddy = { + }; + + services.matrix-synapse = { + settings = { + server_name = "pub.solar"; + public_baseurl = "https://matrix.pub.solar/"; + database = { + name = "psycopg2"; + args.host = "/run/postgresql"; + args.user = ""; + args.database = ""; + }; + + app_service_config_files = [ + ]; + }; + + extraConfigFiles = [ + # registration_shared_secret + # mailer + ]; + + plugins = [ + pkgs.matrix-synapse-plugins.matrix-synapse-shared-secret-auth + ]; + }; + + services.postgresql = { + enable = true; + }; +} diff --git a/hosts/nachtigall/mautrix-telegram.nix b/hosts/nachtigall/mautrix-telegram.nix new file mode 100644 index 0000000..ac73eb3 --- /dev/null +++ b/hosts/nachtigall/mautrix-telegram.nix @@ -0,0 +1,12 @@ +{ config, pkgs, ... }: +{ + servies.mautrix-telegram = { + enable = true; + environmentFile = ""; # Secrets + settings = { + appservice = { + database = "psql:////run/postgresql"; + }; + }; + }; +};