Matrix: Difference between revisions

imported>Pacien
m fix formatting 2
imported>Piegamesde
matrix-appservice-irc
Line 181: Line 181:
==== matrix-appservice-irc ====
==== matrix-appservice-irc ====


Package and module [https://github.com/NixOS/nixpkgs/pull/113988 still a WIP].
NixOS-specific module options: TODO link to the search results once it's landed
 
Full configuration reference: https://github.com/matrix-org/matrix-appservice-irc/blob/develop/config.sample.yaml
 
Upstream documentation: https://matrix-org.github.io/matrix-appservice-irc/latest/introduction.html
 
Example configuration:
 
<syntaxhighlight lang="nix">
services.matrix-appservice-irc = {
  enable = true;
  registrationUrl = "https://ircbridge.mydomain.com"; # Or localhost
 
  # Everything from here is passed to the appservice
  settings = {
    homeserver.url = "https://matrix.mydomain.com"; # Or localhost
    homeserver.domain = "mydomain.com";
 
    # Bridge settings for Freenode. You can bridge multiple services.
    ircService.servers."chat.freenode.net" = {
      name = "freenode";
      port = 6697;
      ssl = true;
      dynamicChannels = {
        enabled = true;
        aliasTemplate = "#irc_$CHANNEL";
        groupId = "+irc:localhost";
      };
      matrixClients = {
        userTemplate = "@irc_$NICK";
      };
      ircClients = {
        nickTemplate = "$LOCALPART[m]";
        allowNickChanges = true;
      };
 
      membershipLists = {
        enabled = true;
        global = {
          ircToMatrix = {
            initial = true;
            incremental = true;
          };
          matrixToIrc = {
            initial = true;
            incremental = true;
          };
        };
      };
    };
  };
};
</syntaxhighlight>
 
This example configuration creates a bridge for only one IRC network, Freenode. Some options are set to make an example, but you absolutely *should* read the whole configuration documentation and set all options you want before starting. The example options show you how to adapt the room/user name space template for the use case where you only have one IRC server bridged, and also enables increased membership sync because it is disabled on the official Freenode bridge.
 
The appservice automatically creates a registration file under `/var/lib/matrix-appservice-irc/registration.yml` and keeps it up to date. If your homeserver is not located on the same machine and NixOS installation, you must absolutely make sure to synchronize that file over to the home server after each modification and keep both in sync.


==== matrix-appservice-discord ====
==== matrix-appservice-discord ====