summary refs log tree commit diff
path: root/pkgs/tools/security/hashcat/default.nix
blob: 81c92415c509a17596c1f1261445999f719833a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ stdenv, fetchurl, makeWrapper, opencl-headers, ocl-icd }:

stdenv.mkDerivation rec {
  name    = "hashcat-${version}";
  version = "4.0.0";

  src = fetchurl {
    url = "https://hashcat.net/files/hashcat-${version}.tar.gz";
    sha256 = "0l1vq4h1gfxc2yclxkvy6gfz6sii2vyzip8pw6ifq930y8dvi34y";
  };

  nativeBuildInputs = [ makeWrapper ];
  buildInputs = [ opencl-headers ];

  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 ];
  };
}