about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/security/hashcat/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/security/hashcat/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/security/hashcat/default.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/security/hashcat/default.nix b/nixpkgs/pkgs/tools/security/hashcat/default.nix
new file mode 100644
index 000000000000..68866a8cad4f
--- /dev/null
+++ b/nixpkgs/pkgs/tools/security/hashcat/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchurl, makeWrapper, opencl-headers, ocl-icd, xxHash }:
+
+stdenv.mkDerivation rec {
+  name    = "hashcat-${version}";
+  version = "5.0.0";
+
+  src = fetchurl {
+    url = "https://hashcat.net/files/hashcat-${version}.tar.gz";
+    sha256 = "13xh1lmzdppvx8wr8blqhdr8vpa24j099kz2xzb9pcnqy26dk4kh";
+  };
+  patches = [ ./use-installed-xxhash.patch ];
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ opencl-headers xxHash ];
+
+  makeFlags = [
+    "OPENCL_HEADERS_KHRONOS=${opencl-headers}/include"
+    "COMPTIME=1337"
+    "VERSION_TAG=${version}"
+  ];
+
+  # $out is not known until the build has started.
+  configurePhase = ''
+    runHook preConfigure
+    makeFlags="$makeFlags PREFIX=$out"
+    runHook postConfigure
+  '';
+
+  postFixup = ''
+    wrapProgram $out/bin/hashcat --prefix LD_LIBRARY_PATH : ${ocl-icd}/lib
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Fast password cracker";
+    homepage    = https://hashcat.net/hashcat/;
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ kierdavis zimbatm ];
+  };
+}