Mobilizon

Free, libre and federated groups and events management platform

Declared in: projects/Mobilizon/default.nix

Demo

Implement missing demo

Options

services.mobilizon
services.mobilizon.enable

Whether to enable Mobilizon federated organization and mobilization platform.

Type:
boolean
Default:
false
Declared in:
nixos/modules/services/web-apps/mobilizon.nix
services.mobilizon.nginx.enable

Whether an Nginx virtual host should be set up to serve Mobilizon.

Type:
boolean
Default:
true
Declared in:
nixos/modules/services/web-apps/mobilizon.nix
services.mobilizon.package

The mobilizon package to use.

Type:
package
Default:
pkgs.mobilizon
Declared in:
nixos/modules/services/web-apps/mobilizon.nix
services.mobilizon.settings

Mobilizon Elixir documentation, see https://docs.joinmobilizon.org/administration/configure/reference/ for supported values.

Type:
open submodule of attribute set of attribute set of (Elixir value)
Default:
{ }
Declared in:
nixos/modules/services/web-apps/mobilizon.nix
services.mobilizon.settings.:mobilizon.:instance.email_from

The email for the From: header in emails

Type:
string or (raw elixir)
Default:
noreply@${settings.":mobilizon".":instance".hostname}
Declared in:
nixos/modules/services/web-apps/mobilizon.nix
services.mobilizon.settings.:mobilizon.:instance.email_reply_to

The email for the Reply-To: header in emails

Type:
string or (raw elixir)
Default:
${email_from}
Declared in:
nixos/modules/services/web-apps/mobilizon.nix
services.mobilizon.settings.:mobilizon.:instance.hostname

Your instance's hostname

Type:
string or (raw elixir)
Declared in:
nixos/modules/services/web-apps/mobilizon.nix
services.mobilizon.settings.:mobilizon.:instance.name

The fallback instance name if not configured into the admin UI

Type:
string or (raw elixir)
Declared in:
nixos/modules/services/web-apps/mobilizon.nix
services.mobilizon.settings.:mobilizon.Mobilizon.Storage.Repo.database

Name of the database

Type:
null or string or (raw elixir)
Default:
"mobilizon_prod"
Declared in:
nixos/modules/services/web-apps/mobilizon.nix
services.mobilizon.settings.:mobilizon.Mobilizon.Storage.Repo.socket_dir

Path to the postgres socket directory.

Set this to null if you want to connect to a remote database.

If non-null, the local PostgreSQL server will be configured with the configured database, permissions, and required extensions.

If connecting to a remote database, please follow the instructions on how to setup your database: https://docs.joinmobilizon.org/administration/install/release/#database-setup

Type:
null or string or (raw elixir)
Default:
"/run/postgresql"
Declared in:
nixos/modules/services/web-apps/mobilizon.nix
services.mobilizon.settings.:mobilizon.Mobilizon.Storage.Repo.username

User used to connect to the database

Type:
null or string or (raw elixir)
Default:
"mobilizon"
Declared in:
nixos/modules/services/web-apps/mobilizon.nix
services.mobilizon.settings.:mobilizon.Mobilizon.Web.Endpoint.has_reverse_proxy

Whether you use a reverse proxy

Type:
boolean or (raw elixir)
Default:
true
Declared in:
nixos/modules/services/web-apps/mobilizon.nix
services.mobilizon.settings.:mobilizon.Mobilizon.Web.Endpoint.http.ip

The IP address to listen on. Defaults to [::1] notated as a byte tuple.

Type:
(elixir tuple) or (raw elixir)
Default:
{ _elixirType = "tuple"; value = [ 0 0 0 0 0 0 0 1 ]; }
Declared in:
nixos/modules/services/web-apps/mobilizon.nix
services.mobilizon.settings.:mobilizon.Mobilizon.Web.Endpoint.http.port

The port to run the server

Type:
16 bit unsigned integer; between 0 and 65535 (both inclusive) or (raw elixir)
Default:
4000
Declared in:
nixos/modules/services/web-apps/mobilizon.nix
services.mobilizon.settings.:mobilizon.Mobilizon.Web.Endpoint.url.host

Your instance's hostname for generating URLs throughout the app

Type:
string or (raw elixir)
Default:
${settings.":mobilizon".":instance".hostname}
Declared in:
nixos/modules/services/web-apps/mobilizon.nix

Examples

prod
{
  config,
  lib,
  pkgs,
  ...
}:
{

  services.mobilizon = {
    enable = true;
    settings =
      let
        # These are helper functions, that allow us to use all the features of the Mix configuration language.
        # - mkAtom and mkRaw both produce "raw" strings, which are not enclosed by quotes.
        # - mkGetEnv allows for convenient calls to System.get_env/2
        inherit ((pkgs.formats.elixirConf { }).lib) mkAtom mkRaw mkGetEnv;
      in
      {
        ":mobilizon" = {

          # General information about the instance
          ":instance" = {
            name = "My mobilizon instance";
            description = "A descriptive text that is going to be shown on the start page.";
            hostname = "your-mobilizon-domain.com";
            email_from = "mail@your-mobilizon-domain.com";
            email_reply_to = "mail@your-mobilizon-domain.com";
          };

          # SMTP configuration
          "Mobilizon.Web.Email.Mailer" = {
            adapter = mkAtom "Swoosh.Adapters.SMTP";
            relay = "your.smtp.server";
            # usually 25, 465 or 587
            port = 587;
            username = "mail@your-mobilizon-domain.com";
            # See "Providing a SMTP password" below
            password = mkGetEnv { envVariable = "SMTP_PASSWORD"; };
            tls = mkAtom ":always";
            allowed_tls_versions = [
              (mkAtom ":tlsv1")
              (mkAtom ":\"tlsv1.1\"")
              (mkAtom ":\"tlsv1.2\"")
            ];
            retries = 1;
            no_mx_lookups = false;
            auth = mkAtom ":always";
          };

        };
      };
  };

  systemd.services.mobilizon.serviceConfig.ImportCredential = [ "mobilizon.SMTP_PASSWORD" ];

  # WARN: !! Don't use this in production !!
  # Instead, put the secrets directly in the systemd credentials store (`/etc/credstore/`, `/run/credstore/`, ...)
  # For more information on this topic, see: <https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#ImportCredential=GLOB>
  environment.etc."credstore/mobilizon.SMTP_PASSWORD".text = "yoursupersecretpassword";

  # In order for Nginx to be publicly accessible, the firewall needs to be configured.
  networking.firewall.allowedTCPPorts = [
    80 # HTTP
    443 # HTTPS
  ];

  # For using the Let's Encrypt TLS certificates for HTTPS,
  # you have to accept their TOS and supply an email address.
  security.acme = {
    acceptTerms = true;
    defaults.email = "letsencrypt@your-mobilizon-domain.com";
  };
}

Declared in: projects/Mobilizon/example.nix

Metadata

This project is funded by NLnet through these subgrants:

Commons
Empowering-Mobilizon
Core
Mobilizon-UX
Review
Mobilizon