at 25.11-pre 1.0 kB view raw
1{ 2 config, 3 lib, 4 pkgs, 5 ... 6}: 7 8let 9 cfg = config.programs.ghidra; 10in 11{ 12 options.programs.ghidra = { 13 enable = lib.mkEnableOption "Ghidra, a software reverse engineering (SRE) suite of tools"; 14 15 gdb = lib.mkOption { 16 default = true; 17 type = lib.types.bool; 18 description = '' 19 Whether to add to gdbinit the python modules required to make Ghidra's debugger work. 20 ''; 21 }; 22 23 package = lib.mkPackageOption pkgs "ghidra" { example = "ghidra-bin"; }; 24 }; 25 26 config = lib.mkIf cfg.enable { 27 environment = { 28 systemPackages = [ cfg.package ]; 29 30 etc = lib.mkIf cfg.gdb { 31 "gdb/gdbinit.d/ghidra-modules.gdb".text = with pkgs.python3.pkgs; '' 32 python 33 import sys 34 [sys.path.append(p) for p in "${ 35 (makePythonPath [ 36 psutil 37 protobuf 38 ]) 39 }".split(":")] 40 end 41 ''; 42 }; 43 }; 44 }; 45 46 meta.maintainers = with lib.maintainers; [ govanify ]; 47}