Merge pull request #60569 from dtzWill/update/vnstat-2.2
vnstat: 2.1 -> 2.2
This commit is contained in:
commit
c17ec06f66
|
@ -28,14 +28,29 @@ in {
|
||||||
path = [ pkgs.coreutils ];
|
path = [ pkgs.coreutils ];
|
||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
unitConfig.documentation = "man:vnstatd(1) man:vnstat(1) man:vnstat.conf(5)";
|
documentation = [
|
||||||
|
"man:vnstatd(1)"
|
||||||
|
"man:vnstat(1)"
|
||||||
|
"man:vnstat.conf(5)"
|
||||||
|
];
|
||||||
preStart = "chmod 755 /var/lib/vnstat";
|
preStart = "chmod 755 /var/lib/vnstat";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${pkgs.vnstat}/bin/vnstatd -n";
|
ExecStart = "${pkgs.vnstat}/bin/vnstatd -n";
|
||||||
ExecReload = "${pkgs.procps}/bin/kill -HUP $MAINPID";
|
ExecReload = "${pkgs.procps}/bin/kill -HUP $MAINPID";
|
||||||
ProtectHome = true;
|
|
||||||
|
# Hardening (from upstream example service)
|
||||||
|
ProtectSystem = "strict";
|
||||||
|
StateDirectory = "vnstat";
|
||||||
PrivateDevices = true;
|
PrivateDevices = true;
|
||||||
|
ProtectKernelTunables = true;
|
||||||
|
ProtectControlGroups = true;
|
||||||
|
ProtectHome = true;
|
||||||
|
ProtectKernelModules = true;
|
||||||
PrivateTmp = true;
|
PrivateTmp = true;
|
||||||
|
MemoryDenyWriteExecute = true;
|
||||||
|
RestrictRealtime = true;
|
||||||
|
RestrictNamespaces = true;
|
||||||
|
|
||||||
User = "vnstatd";
|
User = "vnstatd";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,20 +1,25 @@
|
||||||
{ stdenv, fetchurl, gd, ncurses, sqlite }:
|
{ stdenv, fetchurl, pkgconfig, gd, ncurses, sqlite, check }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "vnstat-${version}";
|
pname = "vnstat";
|
||||||
version = "2.2";
|
version = "2.2";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
sha256 = "0b7020rlc568pz6vkiy28kl8493z88wzrn18wv9b0iq2bv1pn2n6";
|
sha256 = "0b7020rlc568pz6vkiy28kl8493z88wzrn18wv9b0iq2bv1pn2n6";
|
||||||
url = "https://humdi.net/vnstat/${name}.tar.gz";
|
url = "https://humdi.net/${pname}/${pname}-${version}.tar.gz";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ gd ncurses sqlite ];
|
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace src/cfg.c --replace /usr/local $out
|
substituteInPlace src/cfg.c --replace /usr/local $out
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
nativeBuildInputs = [ pkgconfig ];
|
||||||
|
buildInputs = [ gd ncurses sqlite ];
|
||||||
|
|
||||||
|
checkInputs = [ check ];
|
||||||
|
|
||||||
|
doCheck = true;
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Console-based network statistics utility for Linux";
|
description = "Console-based network statistics utility for Linux";
|
||||||
longDescription = ''
|
longDescription = ''
|
||||||
|
|
Loading…
Reference in New Issue