commit d188782baf2c8992c38fafa221c57fe8e824b0ea
parent ec22ec18c42810cb4ec0b2c18f61c6b42455ee2f
Author: Nikolay Korotkiy <sikmir@disroot.org>
Date: Fri, 16 Jun 2023 21:05:15 +0400
Add mqtt-cli
Diffstat:
2 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/pkgs/default.nix b/pkgs/default.nix
@@ -391,6 +391,7 @@ lib.makeScope newScope (
janus-mqtt-proxy = callPackage ./mqtt/janus-mqtt-proxy { };
mongoose = callPackage ./mqtt/mongoose { };
mqtt-benchmark = callPackage ./mqtt/mqtt-benchmark { };
+ mqtt-cli = callPackage ./mqtt/mqtt-cli { };
mqtt-explorer = callPackage ./mqtt/mqtt-explorer { };
mqtt-to-influxdb = callPackage ./mqtt/mqtt-to-influxdb { };
mqtt-to-influxdb-forwarder = callPackage ./mqtt/mqtt-to-influxdb-forwarder { };
diff --git a/pkgs/mqtt/mqtt-cli/default.nix b/pkgs/mqtt/mqtt-cli/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchfromgh, jre, makeWrapper }:
+
+stdenv.mkDerivation (finalAttrs: {
+ pname = "mqtt-cli";
+ version = "4.16.0";
+
+ src = fetchfromgh {
+ owner = "hivemq";
+ repo = "mqtt-cli";
+ name = "mqtt-cli-${finalAttrs.version}.jar";
+ hash = "sha256-MHWDGMDk6WTt3bWenaaGgGg5XgkeiDv7IqChJj1MFO0=";
+ version = "v${finalAttrs.version}";
+ };
+
+ nativeBuildInputs = [ makeWrapper ];
+
+ buildInputs = [ jre ];
+
+ dontUnpack = true;
+
+ installPhase = ''
+ install -dm755 $out/bin
+ install -Dm644 $src $out/share/java/${finalAttrs.src.name}
+
+ makeWrapper ${jre}/bin/java $out/bin/mqtt-cli \
+ --add-flags "-jar $out/share/java/mqtt-cli-${finalAttrs.version}.jar"
+ '';
+
+ meta = with lib; {
+ description = "MQTT CLI";
+ homepage = "https://hivemq.github.io/mqtt-cli/";
+ sourceProvenance = with sourceTypes; [ binaryBytecode ];
+ license = licenses.asl20;
+ maintainers = [ maintainers.sikmir ];
+ platforms = jre.meta.platforms;
+ };
+})