depot/third_party/nixpkgs/pkgs/applications/networking/sniffnet/default.nix
Default email 87f9c27ba9 Project import generated by Copybara.
GitOrigin-RevId: fe2ecaf706a5907b5e54d979fbde4924d84b65fc
2023-04-12 14:48:02 +02:00

65 lines
1.5 KiB
Nix

{ lib
, rustPlatform
, fetchFromGitHub
, pkg-config
, libpcap
, openssl
, stdenv
, alsa-lib
, expat
, fontconfig
, vulkan-loader
, xorg
, darwin
}:
rustPlatform.buildRustPackage rec {
pname = "sniffnet";
version = "1.1.3";
src = fetchFromGitHub {
owner = "gyulyvgc";
repo = "sniffnet";
rev = "refs/tags/v${version}";
hash = "sha256-sJUc14MXaCS4OHtwdCuwI1b7NAlOnaGsXBNUYCEXJqQ=";
};
cargoHash = "sha256-neRVpJmI4TgzvIQqKNqBr61O7rR8246PcxG50IIKE/M=";
nativeBuildInputs = [ pkg-config ];
buildInputs = [
libpcap
openssl
] ++ lib.optionals stdenv.isLinux [
alsa-lib
expat
fontconfig
vulkan-loader
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.AppKit
rustPlatform.bindgenHook
];
# requires internet access
checkFlags = [
"--skip=secondary_threads::check_updates::tests::fetch_latest_release_from_github"
];
postFixup = lib.optionalString stdenv.isLinux ''
patchelf $out/bin/sniffnet \
--add-rpath ${lib.makeLibraryPath [ vulkan-loader 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/v${version}/CHANGELOG.md";
license = with licenses; [ mit /* or */ asl20 ];
maintainers = with maintainers; [ figsoda ];
};
}