3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/networking/iftop/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

36 lines
1.1 KiB
Nix

{ lib, stdenv, fetchurl, ncurses, libpcap, automake, nixosTests }:
stdenv.mkDerivation {
name = "iftop-1.0pre4";
src = fetchurl {
url = "http://ex-parrot.com/pdw/iftop/download/iftop-1.0pre4.tar.gz";
sha256 = "15sgkdyijb7vbxpxjavh5qm5nvyii3fqcg9mzvw7fx8s6zmfwczp";
};
# Explicitly link against libgcc_s, to work around the infamous
# "libgcc_s.so.1 must be installed for pthread_cancel to work".
LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s";
preConfigure = ''
cp ${automake}/share/automake*/config.{sub,guess} config
'';
buildInputs = [ncurses libpcap];
passthru.tests = { inherit (nixosTests) iftop; };
meta = with lib; {
description = "Display bandwidth usage on a network interface";
longDescription = ''
iftop does for network usage what top(1) does for CPU usage. It listens
to network traffic on a named interface and displays a table of current
bandwidth usage by pairs of hosts.
'';
license = licenses.gpl2Plus;
homepage = "http://ex-parrot.com/pdw/iftop/";
platforms = platforms.unix;
maintainers = [ ];
};
}