about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/security/spectre-meltdown-checker/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/security/spectre-meltdown-checker/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/security/spectre-meltdown-checker/default.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/security/spectre-meltdown-checker/default.nix b/nixpkgs/pkgs/tools/security/spectre-meltdown-checker/default.nix
new file mode 100644
index 000000000000..a1844668af65
--- /dev/null
+++ b/nixpkgs/pkgs/tools/security/spectre-meltdown-checker/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchFromGitHub, makeWrapper, coreutils, binutils-unwrapped }:
+
+stdenv.mkDerivation rec {
+  name = "spectre-meltdown-checker-${version}";
+  version = "0.42";
+
+  src = fetchFromGitHub {
+    owner = "speed47";
+    repo = "spectre-meltdown-checker";
+    rev = "v${version}";
+    sha256 = "0pppf844i7b72hqnmfvq72w5y7b6dxd16y29l6j84maf22zxbjni";
+  };
+
+  prePatch = ''
+    substituteInPlace spectre-meltdown-checker.sh \
+      --replace /bin/echo ${coreutils}/bin/echo
+  '';
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  installPhase = with stdenv.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 stdenv.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;
+  };
+}