commit 3f54f4118077b723d2a337d6014734437bff2bb2
parent cb392de5c0de5c302aeb5522dfaebe34314cfa21
Author: Nikolay Korotkiy <sikmir@disroot.org>
Date: Sun, 28 Jul 2024 11:48:28 +0400
Add mqtt-stats
Diffstat:
2 files changed, 53 insertions(+), 0 deletions(-)
diff --git a/pkgs/default.nix b/pkgs/default.nix
@@ -425,6 +425,7 @@ lib.makeScope newScope (
mqtt-launcher = callPackage ./mqtt/mqtt-launcher { };
mqtt-proxy = callPackage ./mqtt/mqtt-proxy { };
mqtt-shell = callPackage ./mqtt/mqtt-shell { };
+ mqtt-stats = callPackage ./mqtt/mqtt-stats { };
mqtt-to-influxdb = callPackage ./mqtt/mqtt-to-influxdb { };
mqtt-to-influxdb-forwarder = callPackage ./mqtt/mqtt-to-influxdb-forwarder { };
nanosdk = callPackage ./mqtt/nanosdk { };
diff --git a/pkgs/mqtt/mqtt-stats/default.nix b/pkgs/mqtt/mqtt-stats/default.nix
@@ -0,0 +1,52 @@
+{
+ lib,
+ fetchFromGitHub,
+ python3Packages,
+ gtk3,
+ gobject-introspection,
+ wrapGAppsHook,
+}:
+
+python3Packages.buildPythonApplication {
+ pname = "mqtt-stats";
+ version = "0-unstable-2023-07-13";
+ format = "other";
+
+ src = fetchFromGitHub {
+ owner = "gambitcomminc";
+ repo = "mqtt-stats";
+ rev = "cd7378df22dce40d4a790e4d4b58b187c141b1dc";
+ hash = "sha256-LkgRubf+Iy+qmoLudGzHjbtzOyKJlxmj5OqxxCIM/2o=";
+ };
+
+ postPatch = ''
+ substituteInPlace mqtt-stats.py \
+ --replace-fail "glade_path = dir_path" "glade_path = \"$out/share/mqtt-stats\""
+ '';
+
+ dontUseSetuptoolsBuild = true;
+ dontUseSetuptoolsCheck = true;
+
+ nativeBuildInputs = [
+ gobject-introspection
+ wrapGAppsHook
+ ];
+
+ dependencies = with python3Packages; [
+ paho-mqtt
+ pygobject3
+ gtk3
+ ];
+
+ installPhase = ''
+ install -Dm755 mqtt-stats.py $out/bin/mqtt-stats
+ install -Dm644 mqtt-stats.glade -t $out/share/mqtt-stats
+ '';
+
+ meta = {
+ description = "MQTT Topic Statistics";
+ homepage = "https://github.com/gambitcomminc/mqtt-stats";
+ license = lib.licenses.lgpl3;
+ maintainers = [ lib.maintainers.sikmir ];
+ };
+}