From 47542a80242c06169b97b94f54e198c6652939ac Mon Sep 17 00:00:00 2001
From: eskytthe <ers@dbc.dk>
Date: Wed, 10 Nov 2021 14:54:04 +0100
Subject: [PATCH] topicctl: init at 1.1.1

---
 pkgs/tools/misc/topicctl/default.nix | 31 ++++++++++++++++++++++++++++
 pkgs/top-level/all-packages.nix      |  2 ++
 2 files changed, 33 insertions(+)
 create mode 100644 pkgs/tools/misc/topicctl/default.nix

diff --git a/pkgs/tools/misc/topicctl/default.nix b/pkgs/tools/misc/topicctl/default.nix
new file mode 100644
index 000000000000..9ecbbcba37af
--- /dev/null
+++ b/pkgs/tools/misc/topicctl/default.nix
@@ -0,0 +1,31 @@
+{ lib, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  pname = "topicctl";
+  version = "1.1.1";
+
+  src = fetchFromGitHub {
+    owner = "segmentio";
+    repo = "topicctl";
+    rev = "v${version}";
+    sha256 = "sha256-LsMt2BHfO0I5N2C247fmoOgQ5EXMgk/3Kj/lI+vTRV0=";
+  };
+
+  vendorSha256 = "sha256-ur7qMm7l1CocQwX58fTL1PpdgIEJyRAzSlNJM1WTvM0=";
+
+  ldflags = [
+    "-X main.BuildVersion=${version}"
+    "-X main.BuildCommitSha=unknown"
+    "-X main.BuildDate=unknown"
+  ];
+
+  # needs a kafka server
+  doCheck = false;
+
+  meta = with lib; {
+    description = "A tool for easy, declarative management of Kafka topics";
+    inherit (src.meta) homepage;
+    license = licenses.mit;
+    maintainers = with maintainers; [ eskytthe srhb ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 548d6e3cefc3..d5f0b26aefd6 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -982,6 +982,8 @@ with pkgs;
 
   tnat64 = callPackage ../tools/networking/tnat64 { };
 
+  topicctl = callPackage ../tools/misc/topicctl { };
+
   veikk-linux-driver-gui = libsForQt5.callPackage ../tools/misc/veikk-linux-driver-gui { };
 
   ventoy-bin = callPackage ../tools/cd-dvd/ventoy-bin { };