summaryrefslogtreecommitdiff
path: root/modules/home
diff options
context:
space:
mode:
authorChristian <[email protected]>2026-05-25 13:14:50 -0500
committerChristian <[email protected]>2026-05-25 13:14:50 -0500
commitcb0ef2c9faff1de5c3e6185e89b1b0c04d10c996 (patch)
treeb3172580dbc2dfd1e1601606684bda6b6af547bf /modules/home
parente0ffe479504212a280934dd8c9a60128fc1e5f5f (diff)
Launch ghidra in PyGhidra mode via bundled pyghidra wheel
Diffstat (limited to 'modules/home')
-rw-r--r--modules/home/re.nix20
1 files changed, 18 insertions, 2 deletions
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
'';
})
];