diff options
Diffstat (limited to 'modules/home/ghidra.nix')
| -rw-r--r-- | modules/home/ghidra.nix | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/home/ghidra.nix b/modules/home/ghidra.nix new file mode 100644 index 0000000..be73c36 --- /dev/null +++ b/modules/home/ghidra.nix @@ -0,0 +1,21 @@ +{ pkgs }: +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 +pkgs.runCommand "ghidra" { buildInputs = [ pkgs.makeWrapper ]; } '' + mkdir -p $out/bin + makeWrapper ${ghidraPython}/bin/python3 $out/bin/ghidra \ + --add-flags "-m pyghidra.ghidra_launch --install-dir ${pkgs.ghidra}/lib/ghidra -g ghidra.GhidraRun" \ + --set JAVA_HOME ${pkgs.jdk21} \ + --prefix PATH : ${pkgs.jdk21}/bin +'' |
