diff --git a/flake.nix b/flake.nix index fca2cf9..c9f6684 100644 --- a/flake.nix +++ b/flake.nix @@ -24,8 +24,8 @@ self, nixpkgs, nur, - blender-bin, nixos-mailserver, + blender-bin, home-manager, ... } @inputs: let diff --git a/nixos/modules/secrets.nix b/nixos/modules/secrets.nix index 27f416e..66c57ff 100644 Binary files a/nixos/modules/secrets.nix and b/nixos/modules/secrets.nix differ diff --git a/nixos/server.nix b/nixos/server.nix index df3a8d2..a9f67fc 100644 --- a/nixos/server.nix +++ b/nixos/server.nix @@ -21,7 +21,6 @@ ./server/acme.nix ./server/ddclient.nix ./server/docker.nix - ./server/element.nix ./server/firewall.nix ./server/gitea.nix ./server/lemmy.nix @@ -33,10 +32,14 @@ ./server/nginx.nix ./server/owncast.nix ./server/pufferpanel.nix - ./server/synapse.nix ./server/tandoor.nix ./server/vaultwarden.nix ./server/misc.nix + + # Matrix + ./server/synapse.nix + ./server/element.nix + ./server/matrix-discord.nix ]; services.openssh.ports = [ 2222 ]; diff --git a/nixos/server/matrix-discord.nix b/nixos/server/matrix-discord.nix new file mode 100644 index 0000000..344af0e --- /dev/null +++ b/nixos/server/matrix-discord.nix @@ -0,0 +1,18 @@ +let + secrets = import ../modules/secrets.nix; +in { + services.matrix-appservice-discord = { + enable = true; + settings = { + auth = { + clientID = "${secrets.discordBotID}"; + botToken = "${secrets.discordBotToken}"; + usePrivilegedIntents = true; + }; + bridge = { + domain = "${secrets.jimDomain}"; + homeserverUrl = "https://matrix.${secrets.jimDomain}"; + }; + }; + }; +} diff --git a/nixos/server/synapse.nix b/nixos/server/synapse.nix index 1b76a42..515c763 100644 --- a/nixos/server/synapse.nix +++ b/nixos/server/synapse.nix @@ -32,6 +32,13 @@ in { require_transport_security = true; }; + # Allows a Discord/Matrix bridge, comment on first use and copy using instructions + app_service_config_files = [ + # cp /var/lib/matrix-appservice-discord/discord-registration.yaml /var/lib/matrix-synapse/ + # chown matrix-synapse:matrix-synapse /var/lib/matrix-synapse/discord-registration.yaml + "/var/lib/matrix-synapse/discord-registration.yaml" + ]; + # Disable registration without email registrations_require_3pid = [ "email" ];