Mosquitto
services.mosquitto.bridges
Bridges to build to other MQTT brokers.
Type: attribute set of (submodule)
Default
{ }
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.bridges.<name>.addresses
Remote endpoints for the bridge.
Type: list of (submodule)
Default
[ ]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.bridges.<name>.addresses.*.address
Address of the remote MQTT broker.
Type: single-line string
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.bridges.<name>.addresses.*.port
Port of the remote MQTT broker.
Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default
1883
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.bridges.<name>.settings
Additional settings for this bridge.
Type: attribute set of (string, path, bool, or integer)
Default
{ }
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.bridges.<name>.topics
Topic patterns to be shared between the two brokers. Refer to the mosquitto.conf documentation for details on the format.
Type: list of single-line string
Default
[ ]
Example
["# both 2 local/topic/ remote/topic/"]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.dataDir
The data directory.
Type: path
Default
"/var/lib/mosquitto"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.enable
Whether to enable the MQTT Mosquitto broker.
Type: boolean
Default
false
Example
true
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.includeDirs
Directories to be scanned for further config files to include.
Directories will processed in the order given,
*.conf
files in the directory will be
read in case-sensitive alphabetical order.
Type: list of path
Default
[ ]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.listeners
Listeners to configure on this broker.
Type: list of (submodule)
Default
{ }
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.listeners.*.acl
Additional ACL items to prepend to the generated ACL file.
Type: list of single-line string
Default
[ ]
Example
["pattern read #""topic readwrite anon/report/#"]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.listeners.*.address
Address to listen on. Listen on 0.0.0.0
/::
when unset.
Type: null or single-line string
Default
null
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.listeners.*.authPlugins
Authentication plugin to attach to this listener. Refer to the mosquitto.conf documentation for details on authentication plugins.
Type: list of (submodule)
Default
[ ]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.listeners.*.authPlugins.*.denySpecialChars
{services-mosquitto-listeners--authPlugins--denySpecialChars}
Automatically disallow all clients using #
or +
in their name/id.
Type: boolean
Default {services-mosquitto-listeners--authPlugins--denySpecialChars-default}
true
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.listeners.*.authPlugins.*.options
{services-mosquitto-listeners--authPlugins--options}
Options for the auth plugin. Each key turns into a auth_opt_*
line in the config.
Type: attribute set of (string, path, bool, or integer)
Default {services-mosquitto-listeners--authPlugins--options-default}
{ }
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.listeners.*.authPlugins.*.plugin
{services-mosquitto-listeners--authPlugins--plugin}
Plugin path to load, should be a .so
file.
Type: path
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.listeners.*.omitPasswordAuth
Omits password checking, allowing anyone to log in with any user name unless other mandatory authentication methods (eg TLS client certificates) are configured.
Type: boolean
Default
false
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.listeners.*.port
Port to listen on. Must be set to 0 to listen on a unix domain socket.
Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default
1883
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.listeners.*.settings
Additional settings for this listener.
Type: attribute set of (string, path, bool, or integer)
Default
{ }
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.listeners.*.users
A set of users and their passwords and ACLs.
Type: attribute set of (submodule)
Default
{ }
Example
{john = {acl = ["readwrite john/#"];password = "123456";};}
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.listeners.*.users.<name>.acl
Control client access to topics on the broker.
Type: list of single-line string
Default
[ ]
Example
["read A/B""readwrite A/#"]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.listeners.*.users.<name>.hashedPassword
Specifies the hashed password for the MQTT User.
To generate hashed password install the mosquitto
package and use mosquitto_passwd
, then extract
the second field (after the :
) from the generated
file.
Type: null or single-line string
Default
null
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.listeners.*.users.<name>.hashedPasswordFile
Specifies the path to a file containing the
hashed password for the MQTT user.
To generate hashed password install the mosquitto
package and use mosquitto_passwd
, then remove the
username:
prefix from the generated file.
The file is securely passed to mosquitto by
leveraging systemd credentials. No special
permissions need to be set on this file.
Type: null or path
Default
null
Example
"/path/to/file"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.listeners.*.users.<name>.password
Specifies the (clear text) password for the MQTT User.
Type: null or single-line string
Default
null
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.listeners.*.users.<name>.passwordFile
Specifies the path to a file containing the clear text password for the MQTT user. The file is securely passed to mosquitto by leveraging systemd credentials. No special permissions need to be set on this file.
Type: null or path
Default
null
Example
"/path/to/file"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.logDest
Destinations to send log messages to.
Type: list of (path or one of "stdout", "stderr", "syslog", "topic", "dlt")
Default
["stderr"]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.logType
Types of messages to log.
Type: list of (one of "debug", "error", "warning", "notice", "information", "subscribe", "unsubscribe", "websockets", "none", "all")
Default
[ ]
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.package
The mosquitto package to use.
Type: package
Default
pkgs.mosquitto
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.persistence
Enable persistent storage of subscriptions and messages.
Type: boolean
Default
true
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix
services.mosquitto.settings
Global configuration options for the mosquitto broker.
Type: attribute set of (string, path, bool, or integer)
Default
{ }
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/mosquitto.nix