mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-20 04:31:52 +00:00
nixos/mosquitto: add package option
This commit is contained in:
parent
eefa3b6f9e
commit
1d3f0903a8
|
@ -136,7 +136,7 @@ let
|
||||||
+ concatStringsSep "\n"
|
+ concatStringsSep "\n"
|
||||||
(plainLines
|
(plainLines
|
||||||
++ optional (plainLines != []) ''
|
++ optional (plainLines != []) ''
|
||||||
${pkgs.mosquitto}/bin/mosquitto_passwd -U "$file"
|
${cfg.package}/bin/mosquitto_passwd -U "$file"
|
||||||
''
|
''
|
||||||
++ hashedLines));
|
++ hashedLines));
|
||||||
|
|
||||||
|
@ -444,6 +444,15 @@ let
|
||||||
globalOptions = with types; {
|
globalOptions = with types; {
|
||||||
enable = mkEnableOption "the MQTT Mosquitto broker";
|
enable = mkEnableOption "the MQTT Mosquitto broker";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = package;
|
||||||
|
default = pkgs.mosquitto;
|
||||||
|
defaultText = literalExpression "pkgs.mosquitto";
|
||||||
|
description = ''
|
||||||
|
Mosquitto package to use.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
bridges = mkOption {
|
bridges = mkOption {
|
||||||
type = attrsOf bridgeOptions;
|
type = attrsOf bridgeOptions;
|
||||||
default = {};
|
default = {};
|
||||||
|
@ -565,7 +574,7 @@ in
|
||||||
RuntimeDirectory = "mosquitto";
|
RuntimeDirectory = "mosquitto";
|
||||||
WorkingDirectory = cfg.dataDir;
|
WorkingDirectory = cfg.dataDir;
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
ExecStart = "${pkgs.mosquitto}/bin/mosquitto -c ${configFile}";
|
ExecStart = "${cfg.package}/bin/mosquitto -c ${configFile}";
|
||||||
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
||||||
|
|
||||||
# Hardening
|
# Hardening
|
||||||
|
|
Loading…
Reference in a new issue