mosquitto
Mosquitto provides a lightweight local MQTT broker for development and testing.
Enable it with:
{ ... }:
{ services.mosquitto.enable = true;}By default, the broker listens on 127.0.0.1 and uses port 1883 through devenv’s dynamic port allocation. The resolved port is exposed as MOSQUITTO_PORT, and the configured host is exposed as MOSQUITTO_HOST.
You can customize the listener or append native Mosquitto configuration:
{ ... }:
{ services.mosquitto = { enable = true; bind = "127.0.0.1"; port = 1883; extraConfig = '' max_queued_messages 1000 ''; };}extraConfig is appended to the generated mosquitto.conf.
Options
Section titled “Options”services.mosquitto.enable
Section titled “services.mosquitto.enable”Whether to enable mosquitto MQTT broker.
Type: boolean
Default:
falseExample:
trueDeclared by:
services.mosquitto.package
Section titled “services.mosquitto.package”Which package of mosquitto to use
Type: package
Default:
pkgs.mosquittoDeclared by:
services.mosquitto.bind
Section titled “services.mosquitto.bind”The IP interface to bind to.
null means “all interfaces”.
Type: null or string
Default:
"127.0.0.1"Example:
"127.0.0.1"Declared by:
services.mosquitto.extraConfig
Section titled “services.mosquitto.extraConfig”Additional text to append to mosquitto.conf.
Type: strings concatenated with “\n”
Default:
""Example:
'' max_queued_messages 1000''Declared by:
services.mosquitto.port
Section titled “services.mosquitto.port”The TCP port to accept MQTT connections.
Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default:
1883Declared by:

