2020-06-27 09:29:45 +02:00
|
|
|
{ stdenv, makeWrapper, fetchFromGitHub, gawk, installShellFiles }:
|
2017-12-07 18:15:50 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "lynis";
|
2020-06-26 19:14:03 +02:00
|
|
|
version = "3.0.0";
|
2017-12-07 18:15:50 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "CISOfy";
|
2019-09-09 01:38:31 +02:00
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2020-06-26 19:14:03 +02:00
|
|
|
sha256 = "05p8h2ww4jcc6lgxrm796cbvlfmw26rxq5fmw0xxavbpadiw752j";
|
2017-12-07 18:15:50 +01:00
|
|
|
};
|
|
|
|
|
2020-06-27 09:29:45 +02:00
|
|
|
nativeBuildInputs = [ installShellFiles makeWrapper ];
|
2017-12-07 18:15:50 +01:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
grep -rl '/usr/local/lynis' ./ | xargs sed -i "s@/usr/local/lynis@$out/share/lynis@g"
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2018-11-10 14:48:26 +01:00
|
|
|
install -d $out/bin $out/share/lynis/plugins
|
2017-12-07 18:15:50 +01: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 ]}
|
2020-06-27 09:29:45 +02:00
|
|
|
|
|
|
|
installManPage lynis.8
|
|
|
|
installShellCompletion --bash --name lynis.bash \
|
|
|
|
extras/bash_completion.d/lynis
|
2017-12-07 18:15:50 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|