nixpkgs/pkgs/tools/security/spectre-meltdown-checker/default.nix
2022-04-01 00:52:22 +00:00

39 lines
1.1 KiB
Nix

{ lib, stdenv, fetchFromGitHub, makeWrapper, coreutils, binutils-unwrapped }:
stdenv.mkDerivation rec {
pname = "spectre-meltdown-checker";
version = "0.45";
src = fetchFromGitHub {
owner = "speed47";
repo = "spectre-meltdown-checker";
rev = "v${version}";
sha256 = "sha256-yGrsiPBux4YeiQ3BL2fnne5P55R/sQZ4FwzSkE6BqPc=";
};
prePatch = ''
substituteInPlace spectre-meltdown-checker.sh \
--replace /bin/echo ${coreutils}/bin/echo
'';
nativeBuildInputs = [ makeWrapper ];
installPhase = with lib; ''
runHook preInstall
install -Dm755 spectre-meltdown-checker.sh $out/bin/spectre-meltdown-checker
wrapProgram $out/bin/spectre-meltdown-checker \
--prefix PATH : ${makeBinPath [ binutils-unwrapped ]}
runHook postInstall
'';
meta = with lib; {
description = "Spectre & Meltdown vulnerability/mitigation checker for Linux";
homepage = "https://github.com/speed47/spectre-meltdown-checker";
license = licenses.gpl3;
maintainers = with maintainers; [ dotlambda ];
platforms = platforms.linux;
};
}