From 1a2fdaae29feb78a483413fb959da93a4a37c03b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 30 Nov 2024 17:44:53 +0100 Subject: [PATCH] mqtt-exporter: init at 1.5.0 Generic MQTT Prometheus exporter for IoT https://github.com/kpetremann/mqtt-exporter --- pkgs/by-name/mq/mqtt-exporter/package.nix | 43 +++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 pkgs/by-name/mq/mqtt-exporter/package.nix diff --git a/pkgs/by-name/mq/mqtt-exporter/package.nix b/pkgs/by-name/mq/mqtt-exporter/package.nix new file mode 100644 index 000000000000..0f0bc14ef29b --- /dev/null +++ b/pkgs/by-name/mq/mqtt-exporter/package.nix @@ -0,0 +1,43 @@ +{ + lib, + python3, + fetchFromGitHub, +}: + +python3.pkgs.buildPythonApplication rec { + pname = "mqtt-exporter"; + version = "1.5.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "kpetremann"; + repo = "mqtt-exporter"; + rev = "refs/tags/v${version}"; + hash = "sha256-3gUAiujfBXJpVailx8cMmSJS7l69XpE4UGK/aebcQqY="; + }; + + pythonRelaxDeps = [ "prometheus-client" ]; + + build-system = with python3.pkgs; [ setuptools ]; + + dependencies = with python3.pkgs; [ + paho-mqtt_2 + prometheus-client + ]; + + nativeCheckInputs = with python3.pkgs; [ + pytest-mock + pytestCheckHook + ]; + + pythonImportsCheck = [ "mqtt_exporter" ]; + + meta = { + description = "Generic MQTT Prometheus exporter for IoT"; + homepage = "https://github.com/kpetremann/mqtt-exporter"; + changelog = "https://github.com/kpetremann/mqtt-exporter/releases/tag/v${version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ fab ]; + mainProgram = "mqtt-exporter"; + }; +}