nixpkgs/pkgs/applications/networking/sniffnet/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

59 lines
1.3 KiB
Nix
Raw Normal View History

2022-12-05 03:58:15 +00:00
{ lib
, rustPlatform
, fetchFromGitHub
2022-12-05 03:58:15 +00:00
, pkg-config
, libpcap
, stdenv
, alsa-lib
, expat
2022-12-05 03:58:15 +00:00
, fontconfig
, vulkan-loader
2022-12-05 03:58:15 +00:00
, xorg
, darwin
}:
rustPlatform.buildRustPackage rec {
pname = "sniffnet";
version = "1.1.2";
2022-12-05 03:58:15 +00:00
src = fetchFromGitHub {
owner = "gyulyvgc";
repo = "sniffnet";
2023-03-19 10:26:51 +00:00
rev = "refs/tags/v${version}";
hash = "sha256-QEMd/vOi0DFCq7AJHhii7rnBAHS89XP3/b2UIewAgLc=";
2022-12-05 03:58:15 +00:00
};
cargoHash = "sha256-VcmiM7prK5l8Ow8K9TGUR2xfx9648IoU6i40hOGAqGQ=";
2022-12-05 03:58:15 +00:00
nativeBuildInputs = [ pkg-config ];
buildInputs = [
libpcap
] ++ lib.optionals stdenv.isLinux [
alsa-lib
expat
2022-12-05 03:58:15 +00:00
fontconfig
vulkan-loader
2022-12-05 03:58:15 +00:00
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.AppKit
rustPlatform.bindgenHook
2022-12-05 03:58:15 +00:00
];
postFixup = lib.optionalString stdenv.isLinux ''
patchelf $out/bin/sniffnet \
--add-rpath ${lib.makeLibraryPath [ vulkan-loader xorg.libX11 ]}
2022-12-05 03:58:15 +00:00
'';
meta = with lib; {
description = "Cross-platform application to monitor your network traffic with ease";
homepage = "https://github.com/gyulyvgc/sniffnet";
2023-03-19 10:26:51 +00:00
changelog = "https://github.com/gyulyvgc/sniffnet/blob/v${version}/CHANGELOG.md";
2022-12-05 03:58:15 +00:00
license = with licenses; [ mit /* or */ asl20 ];
maintainers = with maintainers; [ figsoda ];
};
}