nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 63 lines 2.4 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 fetchpatch, 6 ncurses, 7 autoreconfHook, 8}: 9 10stdenv.mkDerivation rec { 11 version = "0.7.4"; 12 pname = "nload"; 13 14 src = fetchurl { 15 url = "http://www.roland-riegel.de/nload/${pname}-${version}.tar.gz"; 16 sha256 = "1rb9skch2kgqzigf19x8bzk211jdfjfdkrcvaqyj89jy2pkm3h61"; 17 }; 18 19 patches = [ 20 # Fixes an ugly bug of graphs scrolling to the side, corrupting the view. 21 # There is an upstream fix, but not a new upstream release that includes it. 22 # Other distributions like Gentoo also patch this as a result; see: 23 # https://github.com/rolandriegel/nload/issues/3#issuecomment-427579143 24 # TODO Remove when https://github.com/rolandriegel/nload/issues/3 is merged and available 25 (fetchpatch { 26 url = "https://github.com/rolandriegel/nload/commit/8a93886e0fb33a81b8fe32e88ee106a581fedd34.patch"; 27 name = "nload-0.7.4-Eliminate-flicker-on-some-terminals.patch"; 28 sha256 = "10yppy5l50wzpcvagsqkbyf1rcan6aj30am4rw8hmkgnbidf4zbq"; 29 }) 30 # Patches configure.in file to make configure compile on macOS. 31 # Patch taken from MacPorts. 32 (fetchpatch { 33 url = "https://github.com/macports/macports-ports/raw/28814c34711e7545929fd391feb6ce079bd73fd4/net/nload/files/patch-configure.in.diff"; 34 extraPrefix = ""; 35 hash = "sha256-lGbBG5ZOgMVnrwlwXVFGbUZx6RkmQwYSVLB3oqkAWRs="; 36 }) 37 # Fixes crash on F2 and garbage in adapter name. 38 # Patch taken from Homebrew. 39 (fetchpatch { 40 url = "https://sourceforge.net/p/nload/bugs/_discuss/thread/c9b68d8e/4a65/attachment/devreader-bsd.cpp.patch"; 41 extraPrefix = ""; 42 hash = "sha256-umRQDqcRUOGELOx5iB6CPFRkjaD8HXkMCWiKsYdaUa0="; 43 }) 44 ]; 45 46 nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin autoreconfHook; 47 buildInputs = [ ncurses ]; 48 49 meta = { 50 description = "Monitors network traffic and bandwidth usage with ncurses graphs"; 51 longDescription = '' 52 nload is a console application which monitors network traffic and 53 bandwidth usage in real time. It visualizes the in- and outgoing traffic 54 using two graphs and provides additional info like total amount of 55 transfered data and min/max network usage. 56 ''; 57 homepage = "https://www.roland-riegel.de/nload/index.html"; 58 license = lib.licenses.gpl2; 59 platforms = lib.platforms.unix; 60 maintainers = [ lib.maintainers.devhell ]; 61 mainProgram = "nload"; 62 }; 63}