commit 3d43624af250a5013d3e0038ea43a1322a6d94a1
parent 3f54f4118077b723d2a337d6014734437bff2bb2
Author: Nikolay Korotkiy <sikmir@disroot.org>
Date: Sun, 28 Jul 2024 13:14:48 +0400
Add mqtt-logger
Diffstat:
2 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/pkgs/default.nix b/pkgs/default.nix
@@ -423,6 +423,7 @@ lib.makeScope newScope (
mqtt-cli = callPackage ./mqtt/mqtt-cli { };
mqtt-explorer = callPackage ./mqtt/mqtt-explorer { };
mqtt-launcher = callPackage ./mqtt/mqtt-launcher { };
+ mqtt-logger = callPackage ./mqtt/mqtt-logger { };
mqtt-proxy = callPackage ./mqtt/mqtt-proxy { };
mqtt-shell = callPackage ./mqtt/mqtt-shell { };
mqtt-stats = callPackage ./mqtt/mqtt-stats { };
diff --git a/pkgs/mqtt/mqtt-logger/default.nix b/pkgs/mqtt/mqtt-logger/default.nix
@@ -0,0 +1,41 @@
+{
+ lib,
+ fetchFromGitHub,
+ python3Packages,
+}:
+
+python3Packages.buildPythonPackage rec {
+ pname = "mqtt-logger";
+ version = "0.3.6";
+ pyproject = true;
+
+ src = fetchFromGitHub {
+ owner = "Blake-Haydon";
+ repo = "mqtt-logger";
+ rev = "v${version}";
+ hash = "sha256-AG8L2CD+YN6gWswDtsUtUMOA3xC2ro1f1YKYgc4jwXE=";
+ };
+
+ postPatch = ''
+ sed -i 's/==.*//' requirements.txt
+ sed -i 's/rich = "^12.0.0"/rich = "*"/' pyproject.toml
+ '';
+
+ build-system = with python3Packages; [ poetry-core ];
+
+ dependencies = with python3Packages; [
+ commonmark
+ paho-mqtt
+ pygments
+ rich
+ ];
+
+ nativeCheckInputs = with python3Packages; [ pytestCheckHook ];
+
+ meta = {
+ description = "Python based MQTT to SQLite3 logger";
+ homepage = "https://github.com/Blake-Haydon/mqtt-logger";
+ license = lib.licenses.mit;
+ maintainers = [ lib.maintainers.sikmir ];
+ };
+}