lol
1{ lib, stdenv, fetchFromGitHub, rustPlatform, Security }:
2
3rustPlatform.buildRustPackage rec {
4 pname = "bandwhich";
5 version = "0.21.1";
6
7 src = fetchFromGitHub {
8 owner = "imsnif";
9 repo = pname;
10 rev = "v${version}";
11 hash = "sha256-9+7ol2QSIXLkkRt/YlAobZHb3Tm+SmnjW/JufwimMTE=";
12 };
13
14 cargoLock = {
15 lockFile = ./Cargo.lock;
16 outputHashes = {
17 "packet-builder-0.7.0" = "sha256-KxNrnLZ/z3JJ3E1pCTJF9tNXI7XYNRc6ooTUz3avpjw=";
18 };
19 };
20
21 checkFlags = [
22 # failing in upstream CI
23 "--skip=tests::cases::ui::layout_under_50_width_under_50_height"
24 ];
25
26 buildInputs = lib.optional stdenv.isDarwin Security;
27
28 # 10 passed; 47 failed https://hydra.nixos.org/build/148943783/nixlog/1
29 doCheck = !stdenv.isDarwin;
30
31 meta = with lib; {
32 description = "A CLI utility for displaying current network utilization";
33 longDescription = ''
34 bandwhich sniffs a given network interface and records IP packet size, cross
35 referencing it with the /proc filesystem on linux or lsof on MacOS. It is
36 responsive to the terminal window size, displaying less info if there is
37 no room for it. It will also attempt to resolve ips to their host name in
38 the background using reverse DNS on a best effort basis.
39 '';
40 homepage = "https://github.com/imsnif/bandwhich";
41 license = licenses.mit;
42 maintainers = with maintainers; [ Br1ght0ne figsoda ];
43 platforms = platforms.unix;
44 };
45}