2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
2023-02-09 11:40:11 +00:00
|
|
|
, fetchFromGitHub
|
2022-12-17 10:02:37 +00:00
|
|
|
, pkg-config
|
|
|
|
, libpcap
|
|
|
|
, stdenv
|
2023-02-09 11:40:11 +00:00
|
|
|
, alsa-lib
|
|
|
|
, expat
|
2022-12-17 10:02:37 +00:00
|
|
|
, fontconfig
|
|
|
|
, libGL
|
|
|
|
, xorg
|
|
|
|
, darwin
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "sniffnet";
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "1.1.1";
|
2022-12-17 10:02:37 +00:00
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gyulyvgc";
|
|
|
|
repo = "sniffnet";
|
|
|
|
rev = "v${version}";
|
2023-03-04 12:14:45 +00:00
|
|
|
hash = "sha256-o971F3JxZUfTCaLRPYxCsU5UZ2VcvZftVEl/sZAQwpA=";
|
2022-12-17 10:02:37 +00:00
|
|
|
};
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
cargoHash = "sha256-Otn5FvZZkzO0MHiopjU2/+redyusituDQb7DT5bdbPE=";
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libpcap
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
2023-02-09 11:40:11 +00:00
|
|
|
alsa-lib
|
|
|
|
expat
|
2022-12-17 10:02:37 +00:00
|
|
|
fontconfig
|
|
|
|
libGL
|
|
|
|
xorg.libX11
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libXrandr
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
darwin.apple_sdk.frameworks.AppKit
|
2023-02-09 11:40:11 +00:00
|
|
|
rustPlatform.bindgenHook
|
2022-12-17 10:02:37 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postFixup = lib.optionalString stdenv.isLinux ''
|
|
|
|
patchelf $out/bin/sniffnet \
|
|
|
|
--add-rpath ${lib.makeLibraryPath [ libGL xorg.libX11 ]}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Cross-platform application to monitor your network traffic with ease";
|
|
|
|
homepage = "https://github.com/gyulyvgc/sniffnet";
|
|
|
|
changelog = "https://github.com/gyulyvgc/sniffnet/blob/main/CHANGELOG.md";
|
|
|
|
license = with licenses; [ mit /* or */ asl20 ];
|
|
|
|
maintainers = with maintainers; [ figsoda ];
|
|
|
|
};
|
|
|
|
}
|