Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 60 lines 1.3 kB view raw
1{ 2 lib, 3 rustPlatform, 4 fetchFromGitHub, 5 pkg-config, 6 alsa-lib, 7 libpcap, 8 expect, 9}: 10 11rustPlatform.buildRustPackage rec { 12 pname = "nethoscope"; 13 version = "0.1.1"; 14 15 src = fetchFromGitHub { 16 owner = "vvilhonen"; 17 repo = "nethoscope"; 18 rev = "v${version}"; 19 hash = "sha256-v7GO+d4b0N3heN10+WSUJEpcShKmx4BPR1FyZoELWzc="; 20 }; 21 22 cargoHash = "sha256-Psu47S39/46ksv7YUU/Ppq3IB70tL2D5ZjaPdpOrrdM="; 23 24 nativeBuildInputs = [ 25 pkg-config 26 ]; 27 buildInputs = [ 28 alsa-lib 29 libpcap 30 ]; 31 32 LD_LIBRARY_PATH = lib.makeLibraryPath [ 33 libpcap 34 alsa-lib 35 ]; 36 37 doInstallCheck = true; 38 installCheckPhase = '' 39 if [[ "$(${expect}/bin/unbuffer "$out/bin/${pname}" --help 2> /dev/null | strings | grep ${version} | tr -d '\n')" == " ${version}" ]]; then 40 echo '${pname} smoke check passed' 41 else 42 echo '${pname} smoke check failed' 43 return 1 44 fi 45 ''; 46 47 meta = with lib; { 48 description = "Listen to your network traffic"; 49 longDescription = '' 50 Employ your built-in wetware pattern recognition and 51 signal processing facilities to understand your network traffic. 52 ''; 53 homepage = "https://github.com/vvilhonen/nethoscope"; 54 license = licenses.isc; 55 maintainers = with maintainers; [ _0x4A6F ]; 56 platforms = platforms.linux; 57 mainProgram = "nethoscope"; 58 }; 59 60}