mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-27 08:04:14 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
79 lines
2.1 KiB
Nix
79 lines
2.1 KiB
Nix
{ lib
|
|
, rustPlatform
|
|
, fetchFromGitHub
|
|
, pkg-config
|
|
, libpcap
|
|
, libxkbcommon
|
|
, openssl
|
|
, stdenv
|
|
, alsa-lib
|
|
, expat
|
|
, fontconfig
|
|
, vulkan-loader
|
|
, wayland
|
|
, xorg
|
|
, darwin
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "sniffnet";
|
|
version = "1.3.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "gyulyvgc";
|
|
repo = "sniffnet";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-wepy56LOhliU6t0ZRPviEbZtsWNqrtUnpUXsEdkRDqI=";
|
|
};
|
|
|
|
cargoHash = "sha256-cV3WhidnH2CBlmHa3IVHTQfTuPdSHwwY0XhgNPyLDN4=";
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
buildInputs = [
|
|
libpcap
|
|
openssl
|
|
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
|
alsa-lib
|
|
expat
|
|
fontconfig
|
|
vulkan-loader
|
|
xorg.libX11
|
|
xorg.libXcursor
|
|
xorg.libXi
|
|
xorg.libXrandr
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
darwin.apple_sdk.frameworks.AppKit
|
|
rustPlatform.bindgenHook
|
|
];
|
|
|
|
# requires internet access
|
|
checkFlags = [
|
|
"--skip=secondary_threads::check_updates::tests::fetch_latest_release_from_github"
|
|
];
|
|
|
|
postInstall = ''
|
|
for res in $(ls resources/packaging/linux/graphics | sed -e 's/sniffnet_//g' -e 's/x.*//g'); do
|
|
install -Dm444 resources/packaging/linux/graphics/sniffnet_''${res}x''${res}.png \
|
|
$out/share/icons/hicolor/''${res}x''${res}/apps/sniffnet.png
|
|
done
|
|
install -Dm444 resources/packaging/linux/sniffnet.desktop -t $out/share/applications
|
|
substituteInPlace $out/share/applications/sniffnet.desktop \
|
|
--replace 'Exec=/usr/bin/sniffnet' 'Exec=sniffnet'
|
|
'';
|
|
|
|
postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
|
|
patchelf $out/bin/sniffnet \
|
|
--add-rpath ${lib.makeLibraryPath [ vulkan-loader xorg.libX11 libxkbcommon wayland ]}
|
|
'';
|
|
|
|
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 ];
|
|
mainProgram = "sniffnet";
|
|
};
|
|
}
|