nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

commit 863085158027af443aa9bcdabf0180c2862e11ce
parent c7c70c43320c3b279d4c85beb9a136e5999d7598
Author: Nikolay Korotkiy <sikmir@disroot.org>
Date:   Sun, 26 Feb 2023 13:49:17 +0300

Add mqtt-explorer

Diffstat:
Mpkgs/default.nix | 1+
Apkgs/mqtt/mqtt-explorer/default.nix | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+), 0 deletions(-)

diff --git a/pkgs/default.nix b/pkgs/default.nix @@ -362,6 +362,7 @@ lib.makeScope newScope ( janus-mqtt-proxy = callPackage ./mqtt/janus-mqtt-proxy { }; mongoose = callPackage ./mqtt/mongoose { }; mqtt-benchmark = callPackage ./mqtt/mqtt-benchmark { }; + mqtt-explorer = callPackage ./mqtt/mqtt-explorer { }; mqtt-to-influxdb = callPackage ./mqtt/mqtt-to-influxdb { }; mqtt-to-influxdb-forwarder = callPackage ./mqtt/mqtt-to-influxdb-forwarder { }; rumqtt = callPackage ./mqtt/rumqtt { diff --git a/pkgs/mqtt/mqtt-explorer/default.nix b/pkgs/mqtt/mqtt-explorer/default.nix @@ -0,0 +1,59 @@ +{ lib, stdenv, appimageTools, fetchurl, undmg }: + +let + pname = "mqtt-explorer"; + version = "0.3.5"; + + srcs = { + x86_64-linux = fetchurl { + url = "https://github.com/thomasnordquist/MQTT-Explorer/releases/download/v${version}/MQTT-Explorer-${version}.AppImage"; + hash = "sha256-Yfz42+dVIx3xwIOmYltp5e9rYka+KskvQuxJVVBgbg4="; + }; + x86_64-darwin = fetchurl { + url = "https://github.com/thomasnordquist/MQTT-Explorer/releases/download/v${version}/MQTT-Explorer-${version}.dmg"; + hash = "sha256-Cf2qgoxaNGpcaW0oA605vd5zQiZX1m54ccW8Tbe8qvU="; + }; + }; + src = srcs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); + + appimageContents = appimageTools.extract { inherit pname version src; }; + + linux = appimageTools.wrapType2 rec { + inherit pname version src meta; + + extraInstallCommands = '' + mv $out/bin/${pname}-${version} $out/bin/${pname} + + install -Dm444 ${appimageContents}/mqtt-explorer.desktop -t $out/share/applications + substituteInPlace $out/share/applications/mqtt-explorer.desktop \ + --replace "Exec=AppRun" "Exec=$out/bin/mqtt-explorer" + + install -Dm444 ${appimageContents}/mqtt-explorer.png -t $out/share/icons/hicolor/512x512/apps + ''; + }; + + darwin = stdenv.mkDerivation { + inherit pname version src meta; + + nativeBuildInputs = [ undmg ]; + + sourceRoot = "."; + + installPhase = '' + mkdir -p $out/Applications + cp -r *.app $out/Applications + ''; + }; + + meta = with lib; { + description = "An all-round MQTT client that provides a structured topic overview"; + homepage = "https://mqtt-explorer.com/"; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + license = licenses.cc-by-40; + maintainers = with maintainers; [ sikmir ]; + platforms = builtins.attrNames srcs; + }; +in +if stdenv.isDarwin +then darwin +else linux