Merge pull request #306562 from D3vil0p3r/patch-1

htb-toolkit: unstable-2024-01-17 -> 0-unstable-2024-04-22
This commit is contained in:
Emily Trau 2024-04-25 19:37:10 +10:00 committed by GitHub
commit b25ee3cd9d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 12 deletions

View File

@ -17,17 +17,17 @@
rustPlatform.buildRustPackage {
pname = "htb-toolkit";
version = "unstable-2024-01-17";
version = "0-unstable-2024-04-22";
src = fetchFromGitHub {
owner = "D3vil0p3r";
repo = "htb-toolkit";
# https://github.com/D3vil0p3r/htb-toolkit/issues/3
rev = "54e11774ea8746ea540548082d3b25c22306b4fc";
hash = "sha256-QYUqdqFV9Qn+VbJTnz5hx5I0XV1nrzCoCKtRS7jBLsE=";
rev = "921e4b352a9dd8b3bc8ac8774e13509abd179aef";
hash = "sha256-o91p/m06pm9qoYZZVh+qHulqHO2G7xVJQPpEvRsq+8Q=";
};
cargoHash = "sha256-XDE6A6EIAUbuzt8Zb/ROfDAPp0ZyN0WQ4D1gWHjRVhg=";
cargoHash = "sha256-vTUiagI0eTrADr6zCMI5btLRvXgZSaohldg4jYmjfyA=";
# Patch to disable prompt change of the shell when a target machine is run. Needed due to Nix declarative nature
patches = [
@ -39,24 +39,25 @@ rustPlatform.buildRustPackage {
];
buildInputs = [
gnome.gnome-keyring
openssl
] ++ lib.optionals stdenv.isLinux [
gnome.gnome-keyring
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.SystemConfiguration
];
postPatch = ''
substituteInPlace src/manage.rs \
--replace /usr/share/htb-toolkit/icons/ $out/share/htb-toolkit/icons/
--replace-fail /usr/share/icons/htb-toolkit/ $out/share/icons/htb-toolkit/
substituteInPlace src/utils.rs \
--replace /usr/bin/bash ${bash} \
--replace "\"base64\"" "\"${coreutils}/bin/base64\"" \
--replace "\"gunzip\"" "\"${gzip}/bin/gunzip\""
--replace-fail "\"base64\"" "\"${coreutils}/bin/base64\"" \
--replace-fail "\"gunzip\"" "\"${gzip}/bin/gunzip\""
substituteInPlace src/appkey.rs \
--replace secret-tool ${lib.getExe libsecret}
--replace-fail secret-tool ${lib.getExe libsecret}
substituteInPlace src/vpn.rs \
--replace "arg(\"openvpn\")" "arg(\"${openvpn}/bin/openvpn\")" \
--replace "arg(\"killall\")" "arg(\"${killall}/bin/killall\")"
--replace-fail "arg(\"openvpn\")" "arg(\"${openvpn}/bin/openvpn\")" \
--replace-fail "arg(\"killall\")" "arg(\"${killall}/bin/killall\")"
'';
meta = with lib; {