add dragnpkgs version of programs.ghidra
This commit is contained in:
parent
b420af3043
commit
f21591a29f
|
@ -317,6 +317,12 @@ option is passed to systemd `StateDirectory=`
|
||||||
|
|
||||||
the service user and group
|
the service user and group
|
||||||
|
|
||||||
|
### [`programs.ghidra`](./modules/ghidra-client/default.nix)
|
||||||
|
|
||||||
|
like upstream, but patches an issue with loading python packages in the ghidra debug feature
|
||||||
|
|
||||||
|
this will probably get removed once upstream fixes the issue
|
||||||
|
|
||||||
### [`environment.machineInfo`](./modules/machine-info/default.nix)
|
### [`environment.machineInfo`](./modules/machine-info/default.nix)
|
||||||
|
|
||||||
provides options to customize the `/etc/machine-info` file on a NixOS system. See the module itself
|
provides options to customize the `/etc/machine-info` file on a NixOS system. See the module itself
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
{ ... }: {
|
{ ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
|
./modules/ghidra-client
|
||||||
./modules/ghidra-server
|
./modules/ghidra-server
|
||||||
./modules/machine-info
|
./modules/machine-info
|
||||||
./modules/satisfactory-dedicated-server
|
|
||||||
./modules/regdom
|
./modules/regdom
|
||||||
|
./modules/satisfactory-dedicated-server
|
||||||
];
|
];
|
||||||
|
|
||||||
# set some nix settings defaults
|
# set some nix settings defaults
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.programs.ghidra;
|
||||||
|
package = cfg.package;
|
||||||
|
isSplit = lib.any (x: x == "lib") package.outputs;
|
||||||
|
libOutput = if isSplit then package.lib else package;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
disabledModules = [ "programs/ghidra.nix" ];
|
||||||
|
|
||||||
|
options.programs.ghidra = {
|
||||||
|
enable = lib.mkEnableOption "Ghidra, a software reverse engineering (SRE) suite of tools";
|
||||||
|
|
||||||
|
gdb = lib.mkOption {
|
||||||
|
default = true;
|
||||||
|
type = lib.types.bool;
|
||||||
|
description = ''
|
||||||
|
Whether to add to gdbinit the python modules required to make Ghidra's debugger work.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
package = lib.mkPackageOption pkgs "ghidra" { example = "ghidra_headless"; };
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
environment = {
|
||||||
|
systemPackages = [ package ];
|
||||||
|
|
||||||
|
etc = lib.mkIf cfg.gdb {
|
||||||
|
"gdb/gdbinit.d/ghidra-modules.gdb".text = with pkgs.python3.pkgs; ''
|
||||||
|
python
|
||||||
|
import sys
|
||||||
|
[sys.path.append(p) for p in "${
|
||||||
|
(makePythonPath [
|
||||||
|
psutil
|
||||||
|
protobuf
|
||||||
|
])
|
||||||
|
}".split(":")]
|
||||||
|
sys.path.append("${libOutput}/lib/ghidra/Ghidra/Debug/Debugger-agent-gdb/pypkg/src")
|
||||||
|
sys.path.append("${libOutput}/lib/ghidra/Ghidra/Debug/Debugger-rmi-trace/pypkg/src")
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue