nixpkgs/pkgs/tools/security/spectre-meltdown-checker/default.nix

35 lines
1.1 KiB
Nix
Raw Normal View History

2018-01-15 00:50:42 +03:00
{ stdenv, fetchFromGitHub, fetchpatch, makeWrapper, coreutils, binutils-unwrapped }:
2018-01-14 17:38:36 +03:00
stdenv.mkDerivation rec {
name = "spectre-meltdown-checker-${version}";
2018-01-15 00:50:42 +03:00
version = "0.31";
2018-01-14 17:38:36 +03:00
src = fetchFromGitHub {
owner = "speed47";
repo = "spectre-meltdown-checker";
rev = "v${version}";
2018-01-15 00:50:42 +03:00
sha256 = "14g5q2prd5w2zhwi7sr9pnalakd87zkvxk0vrzw4cv3x71d44nk2";
2018-01-14 17:38:36 +03:00
};
prePatch = ''
substituteInPlace spectre-meltdown-checker.sh \
2018-01-15 00:50:42 +03:00
--replace /bin/echo ${coreutils}/bin/echo
2018-01-14 17:38:36 +03:00
'';
nativeBuildInputs = [ makeWrapper ];
installPhase = with stdenv.lib; ''
install -Dt $out/lib spectre-meltdown-checker.sh
makeWrapper $out/lib/spectre-meltdown-checker.sh $out/bin/spectre-meltdown-checker \
--prefix PATH : ${makeBinPath [ binutils-unwrapped ]}
'';
meta = with stdenv.lib; {
description = "Spectre & Meltdown vulnerability/mitigation checker for Linux";
homepage = https://github.com/speed47/spectre-meltdown-checker;
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ dotlambda ];
};
}