Merge pull request #155652 from datafoo/mosquitto-package-option

nixos/mosquitto: add package option
This commit is contained in:
pennae
2022-01-19 16:09:17 +00:00
committed by GitHub
@@ -136,7 +136,7 @@ let
+ concatStringsSep "\n"
(plainLines
++ optional (plainLines != []) ''
${pkgs.mosquitto}/bin/mosquitto_passwd -U "$file"
${cfg.package}/bin/mosquitto_passwd -U "$file"
''
++ hashedLines));
@@ -444,6 +444,15 @@ let
globalOptions = with types; {
enable = mkEnableOption "the MQTT Mosquitto broker";
package = mkOption {
type = package;
default = pkgs.mosquitto;
defaultText = literalExpression "pkgs.mosquitto";
description = ''
Mosquitto package to use.
'';
};
bridges = mkOption {
type = attrsOf bridgeOptions;
default = {};
@@ -565,7 +574,7 @@ in
RuntimeDirectory = "mosquitto";
WorkingDirectory = cfg.dataDir;
Restart = "on-failure";
ExecStart = "${pkgs.mosquitto}/bin/mosquitto -c ${configFile}";
ExecStart = "${cfg.package}/bin/mosquitto -c ${configFile}";
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
# Hardening