@@ -12,6 +12,10 @@ let
1212 keyfile ${cfg.ssl.keyfile}
1313 '';
1414
15+ passwordConf = optionalString cfg.checkPasswords ''
16+ password_file ${cfg.dataDir}/passwd
17+ '';
18+
1519 mosquittoConf = pkgs.writeText "mosquitto.conf" ''
1620 pid_file /run/mosquitto/pid
1721 acl_file ${aclFile}
@@ -19,6 +23,7 @@ let
1923 allow_anonymous ${boolToString cfg.allowAnonymous}
2024 bind_address ${cfg.host}
2125 port ${toString cfg.port}
26+ ${passwordConf}
2227 ${listenerConf}
2328 ${cfg.extraConf}
2429 '';
@@ -153,6 +158,15 @@ in
153158 '';
154159 };
155160
161+ checkPasswords = mkOption {
162+ default = false;
163+ example = true;
164+ type = types.bool;
165+ description = ''
166+ Refuse connection when clients provide incorrect passwords.
167+ '';
168+ };
169+
156170 extraConf = mkOption {
157171 default = "";
158172 type = types.lines;