Home Explore Blog CI



nixpkgs

1st chunk of `nixos/doc/manual/configuration/mattermost.chapter.md`
294c871244e069f5e31bcef3c70ba5480aad586ada22d4dd000000010000092c
# Mattermost {#sec-mattermost}

The NixOS Mattermost module lets you build [Mattermost](https://mattermost.com)
instances for collaboration over chat, optionally with custom builds of plugins
specific to your instance.

To enable Mattermost using Postgres, use a config like this:

```nix
{
  services.mattermost = {
    enable = true;

    # You can change this if you are reverse proxying.
    host = "0.0.0.0";
    port = 8065;

    # Allow modifications to the config from Mattermost.
    mutableConfig = true;

    # Override modifications to the config with your NixOS config.
    preferNixConfig = true;

    socket = {
      # Enable control with the `mmctl` socket.
      enable = true;

      # Exporting the control socket will add `mmctl` to your PATH, and export
      # MMCTL_LOCAL_SOCKET_PATH systemwide. Otherwise, you can get the socket
      # path out of `config.mattermost.socket.path` and set it manually.
      export = true;
    };

    # For example, to disable auto-installation of prepackaged plugins.
    settings.PluginSettings.AutomaticPrepackagedPlugins = false;
  }
}
```

As of NixOS 25.05, Mattermost uses peer authentication with Postgres or
MySQL by default. If you previously used password auth on localhost,
this will automatically be configured if your `stateVersion` is set to at least
`25.05`.

## Using the Mattermost derivation {#sec-mattermost-derivation}

The nixpkgs `mattermost` derivation runs the entire test suite during the
`checkPhase`. This test suite is run with a live MySQL and Postgres database
instance in the sandbox. If you are building Mattermost, this can take a while,
especially if it is building on a resource-constrained system.

The following passthrus are designed to assist with enabling or disabling
the `checkPhase`:

- `mattermost.withTests`
- `mattermost.withoutTests`

The default (`mattermost`) is an alias for `mattermost.withTests`.

## Using Mattermost plugins {#sec-mattermost-plugins}

You can configure Mattermost plugins by either using prebuilt binaries or by
building your own. We test building and using plugins in the NixOS test suite.

Mattermost plugins are tarballs containing a system-specific statically linked
Go binary and webapp resources.

Here is an example with a prebuilt plugin tarball:

```nix
{
  services.mattermost = {
    plugins = with pkgs; [

Title: Mattermost Module in NixOS
Summary
The NixOS Mattermost module facilitates the deployment of Mattermost for team collaboration. It supports custom plugin builds and configuration via NixOS. Key features include easy setup with Postgres, options for mutable and preferred configurations, socket control for mmctl, and plugin management. The module also provides tools to manage the extensive test suite during the build process and offers methods for using both prebuilt and custom-built plugins.