2018-11-10 13:48:26 +00:00
|
|
|
{ stdenv, makeWrapper, fetchFromGitHub, gawk }:
|
2017-12-07 17:15:50 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "lynis";
|
2019-04-15 08:46:24 +01:00
|
|
|
version = "2.7.3";
|
2017-12-07 17:15:50 +00:00
|
|
|
name = "${pname}-${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "CISOfy";
|
|
|
|
repo = "${pname}";
|
|
|
|
rev = "${version}";
|
2019-04-15 08:46:24 +01:00
|
|
|
sha256 = "0md1w86i3fy9l78i98ijr5136nbhdiik2dxyw9qnzmvdlvkqmw70";
|
2017-12-07 17:15:50 +00:00
|
|
|
};
|
|
|
|
|
2018-11-10 13:48:26 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2017-12-07 17:15:50 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
grep -rl '/usr/local/lynis' ./ | xargs sed -i "s@/usr/local/lynis@$out/share/lynis@g"
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2018-11-10 13:48:26 +00:00
|
|
|
install -d $out/bin $out/share/lynis/plugins
|
2017-12-07 17:15:50 +00:00
|
|
|
cp -r include db default.prf $out/share/lynis/
|
|
|
|
cp -a lynis $out/bin
|
|
|
|
wrapProgram "$out/bin/lynis" --prefix PATH : ${stdenv.lib.makeBinPath [ gawk ]}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Security auditing tool for Linux, macOS, and UNIX-based systems";
|
|
|
|
homepage = "https://cisofy.com/lynis/";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = [ maintainers.ryneeverett ];
|
|
|
|
};
|
|
|
|
}
|