Mosquitto 2.1 deprecated the acl_file and password_file config options
in favour of plugins shipping the same code, with removal scheduled for
3.0. Switch the per-listener config generation over to load the plugins
instead.
per_listener_settings is also deprecated but kept for now since the
module design is built around per-listener auth and the 3.0 replacement
semantics are not yet finalised upstream.
A version assertion is added since the plugins only ship with 2.1+.
The auth_plugin and auth_opt_* config keys have been deprecated upstream
in favour of plugin and plugin_opt_*. Both spellings are accepted since
mosquitto 2.0, so this is safe regardless of the package version.
auth_plugin_deny_special_chars has no new-style alias and is kept as-is.
Mosquitto 2.1 introduced a number of new listener, bridge and global
config keys. The module rejects unknown keys via assertKeysValid, so
these need to be added to the allowlists for users to be able to set
them.
The base wrapper falls back to `dbus-run-session sway` when
`DBUS_SESSION_BUS_ADDRESS` is unset. `dbus-run-session` unconditionally
spawns `dbus-daemon` (reference impl) as a fresh session bus, ignoring the
per-user bus already provided by `systemd --user` at
`$XDG_RUNTIME_DIR/bus`.
On NixOS this matters in two ways:
- Under `services.dbus.implementation = "broker"`, sway descendants bypass
the broker user bus and land on a separate `dbus-daemon`, splitting the
session between two buses.
- Even under the reference impl, a redundant second `dbus-daemon` gets
spawned for the sway session.
Prefer the existing user bus at `$XDG_RUNTIME_DIR/bus` when available and
keep `dbus-run-session` only as the last-resort fallback for environments
without a `systemd --user` instance (containers, minimal CI).
dbus-broker provides higher performance and reliability compared to the
classic dbus-daemon. The prerequisite PR #477800 has been merged, making
this switch safe.
Note that services.dbus.implementation is a switch inhibitor: changing
the D-Bus implementation between generations requires a reboot rather
than nixos-rebuild switch, since restarting D-Bus mid-session is unsafe.
Fixes#299476