2021-05-20 23:08:51 +00:00
|
|
|
{ lib, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, gd, ncurses
|
|
|
|
, sqlite
|
|
|
|
, check
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "vnstat";
|
2022-10-30 15:09:59 +00:00
|
|
|
version = "2.10";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vergoh";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-10-30 15:09:59 +00:00
|
|
|
sha256 = "sha256-XBApdQA6E2mx9WPIEiY9z2vxJS3qR0mjBnhbft4LNuQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/cfg.c --replace /usr/local $out
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ gd ncurses sqlite ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ check ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Console-based network statistics utility for Linux";
|
|
|
|
longDescription = ''
|
|
|
|
vnStat is a console-based network traffic monitor for Linux and BSD that
|
|
|
|
keeps a log of network traffic for the selected interface(s). It uses the
|
|
|
|
network interface statistics provided by the kernel as information source.
|
|
|
|
This means that vnStat won't actually be sniffing any traffic and also
|
|
|
|
ensures light use of system resources.
|
|
|
|
'';
|
|
|
|
homepage = "https://humdi.net/vnstat/";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.linux;
|
2021-05-20 23:08:51 +00:00
|
|
|
maintainers = with maintainers; [ evils ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|