nixpkgs/pkgs/by-name/da/darkstat/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

59 lines
1.5 KiB
Nix

{ lib
, stdenv
, autoreconfHook
, fetchFromGitHub
, fetchpatch
, libpcap
, zlib
}:
stdenv.mkDerivation rec {
pname = "darkstat";
version = "3.0.721";
src = fetchFromGitHub {
owner = "emikulic";
repo = pname;
rev = "refs/tags/${version}";
hash = "sha256-kKj4fCgphoe3lojJfARwpITxQh7E6ehUew9FVEW63uQ=";
};
patches = [
# Avoid multiple definitions of CLOCK_REALTIME on macOS 11,
# see https://github.com/emikulic/darkstat/pull/2
(fetchpatch {
url = "https://github.com/emikulic/darkstat/commit/d2fd232e1167dee6e7a2d88b9ab7acf2a129f697.diff";
sha256 = "0z5mpyc0q65qb6cn4xcrxl0vx21d8ibzaam5kjyrcw4icd8yg4jb";
})
];
nativeBuildInputs = [
autoreconfHook
];
buildInputs = [
libpcap
zlib
];
enableParallelBuilding = true;
meta = with lib; {
description = "Network statistics web interface";
longDescription = ''
Captures network traffic, calculates statistics about usage, and serves
reports over HTTP. Features:
- Traffic graphs, reports per host, shows ports for each host.
- Embedded web-server with deflate compression.
- Asynchronous reverse DNS resolution using a child process.
- Small. Portable. Single-threaded. Efficient.
- Supports IPv6.
'';
homepage = "http://unix4lyfe.org/darkstat";
changelog = "https://github.com/emikulic/darkstat/releases/tag/${version}";
license = licenses.gpl2Only;
platforms = with platforms; unix;
mainProgram = "darkstat";
};
}