From cb0ef2c9faff1de5c3e6185e89b1b0c04d10c996 Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 25 May 2026 13:14:50 -0500 Subject: Launch ghidra in PyGhidra mode via bundled pyghidra wheel --- modules/home/re.nix | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'modules/home') diff --git a/modules/home/re.nix b/modules/home/re.nix index 940b273..451d1fe 100644 --- a/modules/home/re.nix +++ b/modules/home/re.nix @@ -4,6 +4,19 @@ inputs, ... }: +let + pyghidra = pkgs.python3Packages.buildPythonPackage { + pname = "pyghidra"; + version = "2.2.1"; + format = "wheel"; + src = "${pkgs.ghidra}/lib/ghidra/Ghidra/Features/PyGhidra/pypkg/dist/pyghidra-2.2.1-py3-none-any.whl"; + propagatedBuildInputs = with pkgs.python3Packages; [ + jpype1 + packaging + ]; + }; + ghidraPython = pkgs.python3.withPackages (_: [ pyghidra ]); +in { home.packages = with pkgs; [ binaryninja-free @@ -13,8 +26,11 @@ paths = [ ghidra ]; buildInputs = [ makeWrapper ]; postBuild = '' - wrapProgram $out/bin/ghidra \ - --set _JAVA_AWT_WM_NONREPARENTING 1 + rm $out/bin/ghidra + makeWrapper ${ghidraPython}/bin/python3 $out/bin/ghidra \ + --add-flags "-m pyghidra.ghidra_launch --install-dir ${ghidra}/lib/ghidra -g ghidra.GhidraRun" \ + --set JAVA_HOME ${pkgs.jdk21} \ + --prefix PATH : ${pkgs.jdk21}/bin ''; }) ]; -- cgit v1.2.3