nur-packages

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

commit 210750059bc21fac7a27d4e4072c24bb5dbad838
parent 2df7bcf5835502c82fcf6f13b7f786b1fb6ee32d
Author: Nikolay Korotkiy <sikmir@disroot.org>
Date:   Thu, 24 Nov 2022 17:11:16 +0300

Add mqtt-to-influxdb

Diffstat:
Mpkgs/default.nix | 1+
Mpkgs/misc/influxdb-cxx/default.nix | 2+-
Apkgs/misc/mqtt-to-influxdb/default.nix | 61+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 63 insertions(+), 1 deletion(-)

diff --git a/pkgs/default.nix b/pkgs/default.nix @@ -319,6 +319,7 @@ lib.makeScope newScope ( miband4 = callPackage ./misc/miband4 { }; morse-talk = callPackage ./misc/morse-talk { }; mqtt-benchmark = callPackage ./misc/mqtt-benchmark { }; + mqtt-to-influxdb = callPackage ./misc/mqtt-to-influxdb { }; musig = callPackage ./misc/musig { }; nanodns = callPackage ./misc/nanodns { }; nmtree = callPackage ./misc/nmtree { }; diff --git a/pkgs/misc/influxdb-cxx/default.nix b/pkgs/misc/influxdb-cxx/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation (finalAttrs: { meta = with lib; { description = "InfluxDB C++ client library"; - inherit (src.meta) homepage; + inherit (finalAttrs.src.meta) homepage; license = licenses.mit; maintainers = [ maintainers.sikmir ]; }; diff --git a/pkgs/misc/mqtt-to-influxdb/default.nix b/pkgs/misc/mqtt-to-influxdb/default.nix @@ -0,0 +1,61 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +, spdlog +, libyamlcpp +, cxxopts +, nlohmann_json +, influxdb-cxx +, boost +, curl +, paho-mqtt-cpp +, paho-mqtt-c +, stduuid +, microsoft_gsl +, catch2 +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "mqtt-to-influxdb"; + version = "0.2.1"; + + src = fetchFromGitHub { + owner = "DavidHamburg"; + repo = "mqtt-to-influxdb"; + rev = "v${finalAttrs.version}"; + hash = "sha256-rTMI9gqjtrmtT9SoYcHHq19Jch1dH7/tmyqz5F4f9Ao="; + fetchSubmodules = true; + }; + + postPatch = '' + substituteInPlace src/libmqtt-to-influxdb/CMakeLists.txt \ + --replace "stdc++fs" "" + substituteInPlace src/app/CMakeLists.txt \ + --replace "/usr" "$out" + ''; + + nativeBuildInputs = [ cmake ]; + + buildInputs = [ + spdlog + libyamlcpp + cxxopts + nlohmann_json + influxdb-cxx + boost + curl + paho-mqtt-cpp + paho-mqtt-c + stduuid + microsoft_gsl + catch2 + ]; + + meta = with lib; { + description = "MQTT message parser for writing statistics into InfluxDB"; + inherit (finalAttrs.src.meta) homepage; + license = licenses.mit; + maintainers = [ maintainers.sikmir ]; + }; +})