synix/docs/modules/nixos/maubot.md
sid 95a533c876
All checks were successful
Deploy docs / build-and-deploy (push) Successful in 3s
initial commit
2026-02-23 20:34:35 +01:00

2.1 KiB

Maubot

A plugin-based Matrix bot system.

Warning: Maubot uses deprecated libolm.

View the synix NixOS module on Forgejo.

References

Sops

Provide the following entries to your host's secrets.yaml:

Replace abc123 with your actual secrets as well as alice and bob with your actual admin user names.

maubot:
  admins:
    alice: abc123
    bob: abc123
    # ...  

Config

This module only works if Matrix Synapse is running on the same machine. See the module on synix.

{
  imports = [ 
    inputs.synix.nixosModules.maubot 
    inputs.synix.nixosModules.matrix-synapse
  ];

  nixpkgs.config.permittedInsecurePackages = [
    "olm-3.2.16"
  ];

  services.maubot = {
    enable = true;
    sops = true;
    admins = [
      "alice"
      "bob"
    ];
    plugins = with config.services.maubot.package.plugins; [
      gitlab
      reminder
    ];
  };

  services.matrix-synapse = {
    enable = true;
    # ...
  };
}

Setup

  1. Create a bot: $ register_new_matrix_user
  2. Login as your admin user: $ mbc login
  3. Authenticate as bot: $ mbc auth
  4. Take note of the access token and device ID
  5. Visit https:/EXAMPLE.TLD/_matrix/maubot
  6. Create a client (if not already preset)
  7. Create an instance

Bots

GitLab

See Readme on GitHub

Create a personal access token with full API access.

!gitlab server login https://git.example.com PERSONAL_ACCESS_TOKEN
!gitlab webhook add https://git.example.com user/project

Check the webhook URL for potential errors.

Tips

Upload a profile picture to Matrix

curl -X POST "https://YOUR_HOMESERVER_URL/_matrix/media/v3/upload" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     -H "Content-Type: image/png" \
     --data-binary "@/path/to/your/image.png"

The respond body contains a valid avatar URL (mxc://...).