From 10520b7d952caa0caf3a423ab5d2b023d249a577 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 10 Jun 2026 02:04:06 +0200 Subject: [PATCH] netflow2ng: init at 0.2.2 NetFlow v9 collector for ntopng https://github.com/synfinatic/netflow2ng --- pkgs/by-name/ne/netflow2ng/package.nix | 56 ++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 pkgs/by-name/ne/netflow2ng/package.nix diff --git a/pkgs/by-name/ne/netflow2ng/package.nix b/pkgs/by-name/ne/netflow2ng/package.nix new file mode 100644 index 000000000000..fd994151395b --- /dev/null +++ b/pkgs/by-name/ne/netflow2ng/package.nix @@ -0,0 +1,56 @@ +{ + lib, + buildGoModule, + fetchFromGitHub, + nix-update-script, + pkg-config, + versionCheckHook, + zeromq, +}: + +buildGoModule (finalAttrs: { + pname = "netflow2ng"; + version = "0.2.2"; + + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "synfinatic"; + repo = "netflow2ng"; + tag = "v${finalAttrs.version}"; + hash = "sha256-cBAgZhHYA9YpQ9NoiW6WNQvPi5nnZ0V3R/bbL8mNXuo="; + }; + + vendorHash = "sha256-2hGY58ofzY7BTIrecdSDoo6JuQwJe4AyNPGiBpGY9lA="; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ zeromq ]; + + nativeInstallCheckInputs = [ versionCheckHook ]; + + ldflags = [ + "-s" + "-X=main.Version=${finalAttrs.version}" + "-X=main.Buildinfos=nixpkgs" + "-X=main.Tag=${finalAttrs.src.tag}" + "-X=main.CommitID=${finalAttrs.src.rev}" + ]; + + doInstallCheck = true; + + postInstall = '' + mv $out/bin/cmd $out/bin/${finalAttrs.pname} + ''; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "NetFlow v9 collector for ntopng"; + homepage = "https://github.com/synfinatic/netflow2ng"; + changelog = "https://github.com/synfinatic/netflow2ng/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ fab ]; + mainProgram = "netflow2ng"; + }; +})