1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-29 00:54:11 +00:00
nixpkgs/pkgs/os-specific/linux/netatop/default.nix

41 lines
1.1 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, kernel, zlib }:
2013-05-20 09:00:03 +01:00
2016-01-07 09:06:40 +00:00
let
version = "0.7";
in
2013-05-20 09:00:03 +01:00
stdenv.mkDerivation {
2016-01-07 09:06:40 +00:00
name = "netatop-${kernel.version}-${version}";
2013-05-20 09:00:03 +01:00
src = fetchurl {
2016-01-07 09:06:40 +00:00
url = "http://www.atoptool.nl/download/netatop-${version}.tar.gz";
sha256 = "11v9lvlshn7mwsbr69xrm7gfhxbgdczcf3cf9fssbd9qgv9abifl";
2013-05-20 09:00:03 +01:00
};
buildInputs = [ zlib ];
preConfigure = ''
patchShebangs mkversion
sed -i -e 's,^KERNDIR.*,KERNDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build,' \
2013-05-20 09:00:03 +01:00
*/Makefile
sed -i -e 's,/lib/modules.*extra,'$out'/lib/modules/${kernel.modDirVersion}/extra,' \
2013-05-20 09:00:03 +01:00
-e s,/usr,$out, \
-e /init.d/d \
-e /depmod/d \
Makefile
'';
preInstall = ''
mkdir -p $out/bin $out/sbin $out/share/man/man{4,8}
mkdir -p $out/lib/modules/${kernel.modDirVersion}/extra
2013-05-20 09:00:03 +01:00
'';
2016-01-07 09:06:40 +00:00
2013-05-20 09:00:03 +01:00
meta = {
description = "Network monitoring module for atop";
homepage = http://www.atoptool.nl/downloadnetatop.php;
license = stdenv.lib.licenses.gpl2;
2013-05-20 09:00:03 +01:00
platforms = stdenv.lib.platforms.linux;
maintainers = with stdenv.lib.maintainers; [viric];
};
}