tsuki/matrix/matrix-appservice-irc: enable lainchan irc bouncer

This commit is contained in:
Oystein Kristoffer Tveit 2023-07-12 01:55:42 +02:00
parent 68b181fc05
commit dddc92877c
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
2 changed files with 69 additions and 4 deletions

View File

@ -1,13 +1,77 @@
{ secrets, ... }:
{
{ config, secrets, ... }: let
cfg = config.services.matrix-appservice-irc;
in {
services.matrix-appservice-irc = {
enable = true;
registrationUrl = "http://localhost:${toString cfg.port}";
settings = {
homeserver = {
url = "https://matrix.nani.wtf";
domain = "nani.wtf";
enablePresence = true;
};
database = {
engine = "postgres";
connectionString = "postgres://matrix-appservice-irc:@localhost:${toString secrets.ports.postgres}/matrix-appservice-irc?sslmode=disable";
};
ircService.servers."irc.lainchan.org" = {
name = "lainchan";
port = 6697;
ssl = true;
networkId = "ircLainchanOrg";
botConfig.enable = false;
dynamicChannels = {
enabled = true;
createAlias = true;
aliasTemplate = "#lainchanirc_$CHANNEL";
published = true;
useHomeserverDirectory = true;
joinRule = "public";
federate = true;
};
matrixClients = {
userTemplate = "@lainanon_$NICK";
};
ircClients = {
nickTemplate = "$LOCALPART[m]";
allowNickChanges = true;
};
membershipLists = {
enabled = true;
global = {
ircToMatrix = {
initial = true;
incremental = true;
};
matrixToIrc = {
initial = true;
incremental = true;
};
};
};
permissions."@h7x4:nani.wtf" = "admin";
# TODO: Port forward
ident.enable = true;
# TODO: Metrics
};
};
};
systemd.services.matrix-appservice-irc = {
requires = [
"matrix-synapse.service"
"postgresql.service"
];
};
}

View File

@ -3,8 +3,7 @@
imports = [
./bridges/mautrix-facebook.nix
./bridges/mx-puppet-discord.nix
# TODO: fix irc service
# ./bridges/matrix-appservice-irc.nix
./bridges/matrix-appservice-irc.nix
./postgres.nix
./coturn.nix
@ -58,6 +57,7 @@
enable_registration = false;
registration_shared_secret = secrets.keys.matrix.registration-shared-secret;
allow_public_rooms_over_federation = true;
# password_config.enabled = lib.mkForce false;
@ -79,6 +79,7 @@
"/var/lib/matrix-synapse/discord-registration.yaml"
# (pkgs.writeText "facebook-registrations.yaml" (builtins.toJSON config.services.mautrix-facebook.registrationData))
"/var/lib/matrix-synapse/facebook-registration.yaml"
"/var/lib/matrix-synapse/irc-registration.yml"
];
# redis.enabled = true;