1 { lib, stdenv, fetchFromGitHub, rustPlatform, Security, installShellFiles }:
3 rustPlatform.buildRustPackage rec {
7 src = fetchFromGitHub {
11 hash = "sha256-8PUtlhy8rsQw3TqgpxWiVettGhncHetWCZcrDXjsR5M=";
15 lockFile = ./Cargo.lock;
17 "packet-builder-0.7.0" = "sha256-KxNrnLZ/z3JJ3E1pCTJF9tNXI7XYNRc6ooTUz3avpjw=";
22 # failing in upstream CI
23 "--skip=tests::cases::ui::layout_under_50_width_under_50_height"
26 nativeBuildInputs = [ installShellFiles ];
28 buildInputs = lib.optional stdenv.hostPlatform.isDarwin Security;
30 # 10 passed; 47 failed https://hydra.nixos.org/build/148943783/nixlog/1
31 doCheck = !stdenv.hostPlatform.isDarwin;
34 ln --force -s ${./Cargo.lock} Cargo.lock
38 export BANDWHICH_GEN_DIR=_shell-files
39 mkdir -p $BANDWHICH_GEN_DIR
43 installManPage $BANDWHICH_GEN_DIR/bandwhich.1
45 installShellCompletion $BANDWHICH_GEN_DIR/bandwhich.{bash,fish} \
46 --zsh $BANDWHICH_GEN_DIR/_bandwhich
50 description = "CLI utility for displaying current network utilization";
52 bandwhich sniffs a given network interface and records IP packet size, cross
53 referencing it with the /proc filesystem on linux or lsof on MacOS. It is
54 responsive to the terminal window size, displaying less info if there is
55 no room for it. It will also attempt to resolve ips to their host name in
56 the background using reverse DNS on a best effort basis.
58 homepage = "https://github.com/imsnif/bandwhich";
59 changelog = "https://github.com/imsnif/bandwhich/blob/${src.rev}/CHANGELOG.md";
60 license = licenses.mit;
61 maintainers = with maintainers; [ Br1ght0ne figsoda ];
62 platforms = platforms.unix;
63 mainProgram = "bandwhich";