2023-07-12 01:55:42 +02:00
|
|
|
{ config, secrets, ... }: let
|
|
|
|
cfg = config.services.matrix-appservice-irc;
|
|
|
|
in {
|
2022-06-22 20:09:30 +02:00
|
|
|
services.matrix-appservice-irc = {
|
|
|
|
enable = true;
|
2023-07-12 01:55:42 +02:00
|
|
|
registrationUrl = "http://localhost:${toString cfg.port}";
|
2022-06-22 20:09:30 +02:00
|
|
|
|
|
|
|
settings = {
|
2023-07-12 01:55:42 +02:00
|
|
|
homeserver = {
|
|
|
|
url = "https://matrix.nani.wtf";
|
|
|
|
domain = "nani.wtf";
|
|
|
|
enablePresence = true;
|
|
|
|
};
|
|
|
|
|
2022-06-22 20:09:30 +02:00
|
|
|
database = {
|
|
|
|
engine = "postgres";
|
|
|
|
connectionString = "postgres://matrix-appservice-irc:@localhost:${toString secrets.ports.postgres}/matrix-appservice-irc?sslmode=disable";
|
|
|
|
};
|
2023-07-12 01:55:42 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
};
|
2022-06-22 20:09:30 +02:00
|
|
|
};
|
|
|
|
};
|
2023-07-12 01:55:42 +02:00
|
|
|
|
|
|
|
systemd.services.matrix-appservice-irc = {
|
|
|
|
requires = [
|
|
|
|
"matrix-synapse.service"
|
|
|
|
"postgresql.service"
|
|
|
|
];
|
|
|
|
};
|
2022-06-22 20:09:30 +02:00
|
|
|
}
|