nixpkgs/pkgs/by-name/nl/nload/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

64 lines
2.4 KiB
Nix

{
lib,
stdenv,
fetchurl,
fetchpatch,
ncurses,
autoreconfHook,
}:
stdenv.mkDerivation rec {
version = "0.7.4";
pname = "nload";
src = fetchurl {
url = "http://www.roland-riegel.de/nload/${pname}-${version}.tar.gz";
sha256 = "1rb9skch2kgqzigf19x8bzk211jdfjfdkrcvaqyj89jy2pkm3h61";
};
patches = [
# Fixes an ugly bug of graphs scrolling to the side, corrupting the view.
# There is an upstream fix, but not a new upstream release that includes it.
# Other distributions like Gentoo also patch this as a result; see:
# https://github.com/rolandriegel/nload/issues/3#issuecomment-427579143
# TODO Remove when https://github.com/rolandriegel/nload/issues/3 is merged and available
(fetchpatch {
url = "https://github.com/rolandriegel/nload/commit/8a93886e0fb33a81b8fe32e88ee106a581fedd34.patch";
name = "nload-0.7.4-Eliminate-flicker-on-some-terminals.patch";
sha256 = "10yppy5l50wzpcvagsqkbyf1rcan6aj30am4rw8hmkgnbidf4zbq";
})
# Patches configure.in file to make configure compile on macOS.
# Patch taken from MacPorts.
(fetchpatch {
url = "https://github.com/macports/macports-ports/raw/28814c34711e7545929fd391feb6ce079bd73fd4/net/nload/files/patch-configure.in.diff";
extraPrefix = "";
hash = "sha256-lGbBG5ZOgMVnrwlwXVFGbUZx6RkmQwYSVLB3oqkAWRs=";
})
# Fixes crash on F2 and garbage in adapter name.
# Patch taken from Homebrew.
(fetchpatch {
url = "https://sourceforge.net/p/nload/bugs/_discuss/thread/c9b68d8e/4a65/attachment/devreader-bsd.cpp.patch";
extraPrefix = "";
hash = "sha256-umRQDqcRUOGELOx5iB6CPFRkjaD8HXkMCWiKsYdaUa0=";
})
];
nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin autoreconfHook;
buildInputs = [ ncurses ];
meta = {
description = "Monitors network traffic and bandwidth usage with ncurses graphs";
longDescription = ''
nload is a console application which monitors network traffic and
bandwidth usage in real time. It visualizes the in- and outgoing traffic
using two graphs and provides additional info like total amount of
transfered data and min/max network usage.
'';
homepage = "http://www.roland-riegel.de/nload/index.html";
license = lib.licenses.gpl2;
platforms = lib.platforms.unix;
maintainers = [ lib.maintainers.devhell ];
mainProgram = "nload";
};
}