nur-packages

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

commit a99a3242db4a1262d1d5318d35312edd3319145f
parent 60c978936033b72d49400b19483b1c0b500bd658
Author: Nikolay Korotkiy <sikmir@disroot.org>
Date:   Thu, 24 Nov 2022 17:37:54 +0300

Add mqtt-to-influxdb-forwarder

Diffstat:
Mpkgs/default.nix | 1+
Apkgs/mqtt/mqtt-to-influxdb-forwarder/default.nix | 34++++++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/pkgs/default.nix b/pkgs/default.nix @@ -348,6 +348,7 @@ lib.makeScope newScope ( influxdb-cxx = callPackage ./mqtt/influxdb-cxx { }; mqtt-benchmark = callPackage ./mqtt/mqtt-benchmark { }; mqtt-to-influxdb = callPackage ./mqtt/mqtt-to-influxdb { }; + mqtt-to-influxdb-forwarder = callPackage ./mqtt/mqtt-to-influxdb-forwarder { }; ### NAKARTE diff --git a/pkgs/mqtt/mqtt-to-influxdb-forwarder/default.nix b/pkgs/mqtt/mqtt-to-influxdb-forwarder/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchFromGitHub, python3Packages }: + +python3Packages.buildPythonApplication rec { + pname = "mqtt-to-influxdb-forwarder"; + version = "2.1.0"; + format = "other"; + + src = fetchFromGitHub { + owner = "mhaas"; + repo = "mqtt-to-influxdb-forwarder"; + rev = "v${version}"; + hash = "sha256-2n5YF5aLaUzHmxgPhnRXXyhoXV0nJ21aa7g+NBTYvBk="; + }; + + postPatch = '' + substituteInPlace forwarder.py --replace "ur'" "r'" + ''; + + dontUseSetuptoolsBuild = true; + dontUseSetuptoolsCheck = true; + + propagatedBuildInputs = with python3Packages; [ paho-mqtt influxdb ]; + + installPhase = '' + install -Dm755 forwarder.py $out/bin/mqtt-to-influxdb-forwarder + ''; + + meta = with lib; { + description = "IoT MQTT to InfluxDB forwarder"; + inherit (src.meta) homepage; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ sikmir ]; + }; +}