16 rustPlatform.buildRustPackage {
17 pname = "htb-toolkit";
18 version = "0-unstable-2024-04-22";
20 src = fetchFromGitHub {
23 # https://github.com/D3vil0p3r/htb-toolkit/issues/3
24 rev = "921e4b352a9dd8b3bc8ac8774e13509abd179aef";
25 hash = "sha256-o91p/m06pm9qoYZZVh+qHulqHO2G7xVJQPpEvRsq+8Q=";
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
32 ./disable-shell-prompt-change.patch
41 ] ++ lib.optionals stdenv.hostPlatform.isLinux [
43 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
44 darwin.apple_sdk.frameworks.Security
45 darwin.apple_sdk.frameworks.SystemConfiguration
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\")"
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;