2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, makeWrapper, fetchFromGitHub, gawk, installShellFiles }:
|
2017-12-07 17:15:50 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "lynis";
|
2022-05-26 19:59:45 +00:00
|
|
|
version = "3.0.8";
|
2017-12-07 17:15:50 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "CISOfy";
|
2019-09-08 23:38:31 +00:00
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-05-26 19:59:45 +00:00
|
|
|
sha256 = "sha256-fPQX/Iz+dc3nF3xMPt0bek4JC2XSHe4aC4O0tZwLf6Y=";
|
2017-12-07 17:15:50 +00:00
|
|
|
};
|
|
|
|
|
2020-06-27 07:29:45 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles 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
|
2021-01-15 09:19:50 +00:00
|
|
|
wrapProgram "$out/bin/lynis" --prefix PATH : ${lib.makeBinPath [ gawk ]}
|
2020-06-27 07:29:45 +00:00
|
|
|
|
|
|
|
installManPage lynis.8
|
|
|
|
installShellCompletion --bash --name lynis.bash \
|
|
|
|
extras/bash_completion.d/lynis
|
2017-12-07 17:15:50 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-12-07 17:15:50 +00:00
|
|
|
description = "Security auditing tool for Linux, macOS, and UNIX-based systems";
|
|
|
|
homepage = "https://cisofy.com/lynis/";
|
2021-05-23 09:56:25 +00:00
|
|
|
license = licenses.gpl3Only;
|
2017-12-07 17:15:50 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = [ maintainers.ryneeverett ];
|
|
|
|
};
|
|
|
|
}
|