Skip to content
20 changes: 6 additions & 14 deletions modules/lib/maintainers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,6 @@
github = "danjujan";
githubId = 44864658;
};
delafthi = {
name = "Thierry Delafontaine";
email = "[email protected]";
matrix = "@delafthi:matrix.org";
github = "delafthi";
githubId = 50531499;
keys = [ { fingerprint = "6DBB 0BB9 AEE6 2C2A 8059 7E1C 0092 6686 9818 63CB"; } ];
};
Dines97 = {
name = "Denis Kaynar";
email = "[email protected]";
Expand All @@ -147,6 +139,12 @@
githubId = 32838899;
name = "Daniel Wagenknecht";
};
ErrorTeaPot = {
name = "ErrorTeaPot";
email = "[email protected]";
github = "ErrorTeaPot";
githubId = 98967114;
};
fendse = {
email = "[email protected]";
github = "Fendse";
Expand Down Expand Up @@ -324,12 +322,6 @@
github = "miku4k";
githubId = 89653242;
};
m0nsterrr = {
name = "Ludovic Ortega";
email = "[email protected]";
github = "M0NsTeRRR";
githubId = 37785089;
};
mager = {
email = "[email protected]";
github = "AndreasMager";
Expand Down
45 changes: 45 additions & 0 deletions modules/programs/ghidra.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
config,
lib,
pkgs,
...
}:

let
cfg = config.programs.ghidra;
in
{
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-bin"; };
};

config = lib.mkIf cfg.enable {
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];

xdg.configFile = 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(":")]
end
'';
};
};

meta.maintainers = with lib.hm.maintainers; [ ErrorTeaPot ];
}
15 changes: 15 additions & 0 deletions tests/modules/programs/ghidra/basic-configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{ config, ... }:

{
config = {
programs.ghidra = {
enable = true;
gdb = true;
};

nmt.script = ''
gdbConfigDir=home-files/.config/gdb
assertFileExists $gdbConfigDir/gdbinit.d/ghidra-modules.gdb
'';
};
}
4 changes: 4 additions & 0 deletions tests/modules/programs/ghidra/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{ lib, pkgs, ... }:
lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
ghidra-basic-configuration = ./basic-configuration.nix;
}
Loading