Skip to content

Commit 6a3f025

Browse files
committed
nixos/ghidra: init
1 parent faa6381 commit 6a3f025

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

nixos/doc/manual/release-notes/rl-2505.section.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767

6868
- [Homer](https://homer-demo.netlify.app/), a very simple static homepage for your server. Available as [services.homer](options.html#opt-services.homer).
6969

70+
- [Ghidra](https://ghidra-sre.org/), a software reverse engineering (SRE) suite of tools. Available as [programs.ghidra](options.html#opt-programs.ghidra).
71+
7072
- [Omnom](https://github.com/asciimoo/omnom), a webpage bookmarking and snapshotting service. Available as [services.omnom](options.html#opt-services.omnom.enable).
7173

7274
- [Yggdrasil-Jumper](https://github.com/one-d-wide/yggdrasil-jumper) is an independent project that aims to transparently reduce latency of a connection over Yggdrasil network, utilizing NAT traversal to automatically bypass intermediary nodes.

nixos/modules/module-list.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@
209209
./programs/gamescope.nix
210210
./programs/gdk-pixbuf.nix
211211
./programs/geary.nix
212+
./programs/ghidra.nix
212213
./programs/git.nix
213214
./programs/git-worktree-switcher.nix
214215
./programs/gnome-disks.nix

nixos/modules/programs/ghidra.nix

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
config,
3+
lib,
4+
pkgs,
5+
...
6+
}:
7+
8+
let
9+
cfg = config.programs.ghidra;
10+
in
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+
}

0 commit comments

Comments
 (0)