Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
68 lines
1.7 KiB
Nix
68 lines
1.7 KiB
Nix
{
|
|
lib,
|
|
rustPlatform,
|
|
fetchFromGitHub,
|
|
pkg-config,
|
|
openssl,
|
|
stdenv,
|
|
coreutils,
|
|
gnome-keyring,
|
|
libsecret,
|
|
openvpn,
|
|
gzip,
|
|
killall,
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage {
|
|
pname = "htb-toolkit";
|
|
version = "0-unstable-2025-03-15";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "D3vil0p3r";
|
|
repo = "htb-toolkit";
|
|
# https://github.com/D3vil0p3r/htb-toolkit/issues/3
|
|
rev = "dd193c2974cd5fd1bbc6f7f616ebd597e28539ec";
|
|
hash = "sha256-NTZv0BPyIB32CNXbINYTy4n8tNVJ3pRLr1QDhI/tg2Y=";
|
|
};
|
|
|
|
cargoHash = "sha256-ReEe8pyW66GXIPwAy6IKsFEAUjxHmzw5mj21i/h4quQ=";
|
|
|
|
# Patch to disable prompt change of the shell when a target machine is run. Needed due to Nix declarative nature
|
|
patches = [
|
|
./disable-shell-prompt-change.patch
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
pkg-config
|
|
];
|
|
|
|
buildInputs = [
|
|
openssl
|
|
]
|
|
++ lib.optionals stdenv.hostPlatform.isLinux [
|
|
gnome-keyring
|
|
];
|
|
|
|
postPatch = ''
|
|
substituteInPlace src/manage.rs \
|
|
--replace-fail /usr/share/icons/htb-toolkit/ $out/share/icons/htb-toolkit/
|
|
substituteInPlace src/utils.rs \
|
|
--replace-fail "\"base64\"" "\"${coreutils}/bin/base64\"" \
|
|
--replace-fail "\"gunzip\"" "\"${gzip}/bin/gunzip\""
|
|
substituteInPlace src/appkey.rs \
|
|
--replace-fail secret-tool ${lib.getExe libsecret}
|
|
substituteInPlace src/vpn.rs \
|
|
--replace-fail "arg(\"openvpn\")" "arg(\"${openvpn}/bin/openvpn\")" \
|
|
--replace-fail "arg(\"killall\")" "arg(\"${killall}/bin/killall\")"
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Play Hack The Box directly on your system";
|
|
mainProgram = "htb-toolkit";
|
|
homepage = "https://github.com/D3vil0p3r/htb-toolkit";
|
|
maintainers = with maintainers; [ d3vil0p3r ];
|
|
platforms = platforms.unix;
|
|
license = licenses.gpl3Plus;
|
|
};
|
|
}
|