chromium,chromedriver: 129.0.6668.91 -> 129.0.6668.100
[NixPkgs.git] / pkgs / by-name / ht / htb-toolkit / package.nix
blobdf3c8cde12751a72c3baf64709240cd1681c31f9
1 { lib
2 , rustPlatform
3 , fetchFromGitHub
4 , pkg-config
5 , openssl
6 , stdenv
7 , darwin
8 , coreutils
9 , gnome-keyring
10 , libsecret
11 , openvpn
12 , gzip
13 , killall
16 rustPlatform.buildRustPackage {
17   pname = "htb-toolkit";
18   version = "0-unstable-2024-04-22";
20   src = fetchFromGitHub {
21     owner = "D3vil0p3r";
22     repo = "htb-toolkit";
23     # https://github.com/D3vil0p3r/htb-toolkit/issues/3
24     rev = "921e4b352a9dd8b3bc8ac8774e13509abd179aef";
25     hash = "sha256-o91p/m06pm9qoYZZVh+qHulqHO2G7xVJQPpEvRsq+8Q=";
26   };
28   cargoHash = "sha256-vTUiagI0eTrADr6zCMI5btLRvXgZSaohldg4jYmjfyA=";
30   # Patch to disable prompt change of the shell when a target machine is run. Needed due to Nix declarative nature
31   patches = [
32     ./disable-shell-prompt-change.patch
33   ];
35   nativeBuildInputs = [
36     pkg-config
37   ];
39   buildInputs = [
40     openssl
41   ] ++ lib.optionals stdenv.hostPlatform.isLinux [
42     gnome-keyring
43   ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
44     darwin.apple_sdk.frameworks.Security
45     darwin.apple_sdk.frameworks.SystemConfiguration
46   ];
48   postPatch = ''
49     substituteInPlace src/manage.rs \
50       --replace-fail /usr/share/icons/htb-toolkit/ $out/share/icons/htb-toolkit/
51     substituteInPlace src/utils.rs \
52       --replace-fail "\"base64\"" "\"${coreutils}/bin/base64\"" \
53       --replace-fail "\"gunzip\"" "\"${gzip}/bin/gunzip\""
54     substituteInPlace src/appkey.rs \
55       --replace-fail secret-tool ${lib.getExe libsecret}
56     substituteInPlace src/vpn.rs \
57       --replace-fail "arg(\"openvpn\")" "arg(\"${openvpn}/bin/openvpn\")" \
58       --replace-fail "arg(\"killall\")" "arg(\"${killall}/bin/killall\")"
59   '';
61   meta = with lib; {
62     description = "Play Hack The Box directly on your system";
63     mainProgram = "htb-toolkit";
64     homepage = "https://github.com/D3vil0p3r/htb-toolkit";
65     maintainers = with maintainers; [ d3vil0p3r ];
66     platforms = platforms.unix;
67     license = licenses.gpl3Plus;
68   };