git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #27131 from richardlarocque/mosquitto_pw

mosquitto: Explicitly configure password file

commited250d809359a21cbc13255c3ee3861ce695bce1 authorJoachim F <joachifm@users.noreply.github.com> dateSat 13 Jan 2018, 12:02 (9 years ago) parent5f8bb3f66b07e4
1 file changed+14
nixos/modules/services/networking/mosquitto.nix+14
nixos/modules/services/networking/mosquitto.nix+14
@@ -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;