From 8c11d8fcc289d7a1763d6e948c8480d142d619d4 Mon Sep 17 00:00:00 2001
From: Viktor Pocedulic <kvik@a-b.xyz>
Date: Wed, 3 Jul 2024 23:20:53 +0200
Subject: [PATCH] nicstat: init at 0-unstable-2018-05-09

---
 pkgs/by-name/ni/nicstat/package.nix | 49 +++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 pkgs/by-name/ni/nicstat/package.nix

diff --git a/pkgs/by-name/ni/nicstat/package.nix b/pkgs/by-name/ni/nicstat/package.nix
new file mode 100644
index 000000000000..d8da45a6082c
--- /dev/null
+++ b/pkgs/by-name/ni/nicstat/package.nix
@@ -0,0 +1,49 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, installShellFiles
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "nicstat";
+  version = "0-unstable-2018-05-09";
+
+  src = fetchFromGitHub {
+    owner = "scotte";
+    repo = "nicstat";
+    rev = "1fbe28198b49a2062b0c928554f93db33cb288c3";
+    hash = "sha256-7+11K9636dGeW0HaaH6OJF5Wy4CXYXfoaZOVfhHK6kg=";
+  };
+
+  nativeBuildInputs = [ installShellFiles ];
+
+  buildPhase = ''
+    runHook preBuild
+
+    $CC -O2 nicstat.c -o nicstat
+
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    install -d "$out/bin"
+    install -m 755 nicstat "$out/bin"
+
+    installManPage nicstat.1
+
+    runHook postInstall
+  '';
+
+  meta = {
+    description = "Network traffic statistics utility for Solaris and Linux";
+    homepage = "https://github.com/scotte/nicstat";
+    changelog = "https://github.com/scotte/nicstat/blob/${finalAttrs.src.rev}/ChangeLog.txt";
+    license = lib.licenses.artistic2;
+    maintainers = with lib.maintainers; [ juliusrickert ];
+    mainProgram = "nicstat";
+    platforms = lib.platforms.unix;
+    broken = stdenv.isDarwin;
+  };
+})