commit a994f05bbcae711b46b3c03a75192b495061eec7
parent 1fea579ef51ca71296cb802fcfee0c39d99ae38b
Author: Nikolay Korotkiy <sikmir@disroot.org>
Date: Tue, 25 Feb 2025 20:00:03 +0400
Add volantmq
Diffstat:
2 files changed, 60 insertions(+), 0 deletions(-)
diff --git a/pkgs/default.nix b/pkgs/default.nix
@@ -456,6 +456,7 @@ lib.makeScope newScope (
pytest-mqtt = callPackage ./mqtt/pytest-mqtt { };
rmqtt = callPackage ./mqtt/rmqtt { };
rumqtt = callPackage ./mqtt/rumqtt { };
+ volantmq = callPackage ./mqtt/volantmq { };
### NAKARTE
diff --git a/pkgs/mqtt/volantmq/default.nix b/pkgs/mqtt/volantmq/default.nix
@@ -0,0 +1,59 @@
+{
+ lib,
+ fetchFromGitHub,
+ buildGoModule,
+}:
+
+buildGoModule rec {
+ pname = "volantmq";
+ version = "0.4.0-rc.8";
+
+ src = fetchFromGitHub {
+ owner = "VolantMQ";
+ repo = "volantmq";
+ tag = "v${version}";
+ hash = "sha256-c/Ae3wYWzi7btzr8+ia6su7NPtvgjtkTxRyPRJduAcY=";
+ };
+
+ vendorHash = "sha256-YLlYOUTli3FXoNC8bUwLXLdwRxRdZ3zPYpE8KwwhuXM=";
+
+ postPatch = ''
+ substituteInPlace configuration/init.go --replace-fail "/var/lib" "$out/lib"
+ '';
+
+ subPackages = [ "cmd/volantmq" ];
+
+ ldflags = [
+ "-s"
+ "-w"
+ "-X main.version=${version}"
+ ];
+
+ postBuild =
+ let
+ plugins = [
+ "debug"
+ "health"
+ "prometheus"
+ "systree"
+ "persistence_bbolt"
+ "auth_http"
+ ];
+ in
+ ''
+ ${lib.concatMapStringsSep "\n" (plugin: ''
+ go build -buildmode=plugin -ldflags "${builtins.toString ldflags}" -o plugins/${plugin}.so
+ '') plugins}
+ '';
+
+ postInstall = ''
+ install -Dm644 plugins/*.so -t $out/lib/volantmq/plugins
+ '';
+
+ meta = {
+ description = "High-Performance MQTT Server";
+ homepage = "https://github.com/VolantMQ/volantmq";
+ license = lib.licenses.asl20;
+ maintainers = [ lib.maintainers.sikmir ];
+ };
+}