Home Explore Blog Models CI



nixpkgs

1st chunk of `nixos/modules/services/matrix/maubot.md`
04b2bd19062c07c7ad2de63280c1b4a0d77d3af50ba07fa700000001000007e7
# Maubot {#module-services-maubot}

[Maubot](https://github.com/maubot/maubot) is a plugin-based bot
framework for Matrix.

## Configuration {#module-services-maubot-configuration}

1. Set [](#opt-services.maubot.enable) to `true`. The service will use
   SQLite by default.
2. If you want to use PostgreSQL instead of SQLite, do this:

   ```nix
   { services.maubot.settings.database = "postgresql://maubot@localhost/maubot"; }
   ```

   If the PostgreSQL connection requires a password, you will have to
   add it later on step 8.
3. If you plan to expose your Maubot interface to the web, do something
   like this:
   ```nix
   {
     services.nginx.virtualHosts."matrix.example.org".locations = {
       "/_matrix/maubot/" = {
         proxyPass = "http://127.0.0.1:${toString config.services.maubot.settings.server.port}";
         proxyWebsockets = true;
       };
     };
     services.maubot.settings.server.public_url = "matrix.example.org";
     # do the following only if you want to use something other than /_matrix/maubot...
     services.maubot.settings.server.ui_base_path = "/another/base/path";
   }
   ```
4. Optionally, set `services.maubot.pythonPackages` to a list of python3
   packages to make available for Maubot plugins.
5. Optionally, set `services.maubot.plugins` to a list of Maubot
   plugins (full list available at <https://plugins.maubot.xyz/>):
   ```nix
   {
     services.maubot.plugins = with config.services.maubot.package.plugins; [
       reactbot
       # This will only change the default config! After you create a
       # plugin instance, the default config will be copied into that
       # instance's config in Maubot's database, and further base config
       # changes won't affect the running plugin.
       (rss.override {
         base_config = {
           update_interval = 60;
           max_backoff = 7200;
           spam_sleep = 2;
           command_prefix = "rss";
           admins = [ "@chayleaf:pavluk.org" ];
         };
       })
     ];
     # ...or...

Title: Maubot Service Configuration
Summary
This document outlines the steps to configure Maubot, a plugin-based bot framework for Matrix. It details how to enable the service, choose between SQLite (default) or PostgreSQL for the database, and expose the Maubot interface to the web using Nginx. Additionally, it covers optional configurations for adding Python packages for plugins and installing specific Maubot plugins, including how to set their base configurations.