Unverified Commit 8706be35 authored by Jörg Thalheim's avatar Jörg Thalheim Committed by GitHub
Browse files

nixos/ghidra: init (#375831)

parents dd61bb41 6a3f025e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -69,6 +69,8 @@

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

- [Ghidra](https://ghidra-sre.org/), a software reverse engineering (SRE) suite of tools. Available as [programs.ghidra](options.html#opt-programs.ghidra).

- [Omnom](https://github.com/asciimoo/omnom), a webpage bookmarking and snapshotting service. Available as [services.omnom](options.html#opt-services.omnom.enable).

- [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.
+1 −0
Original line number Diff line number Diff line
@@ -209,6 +209,7 @@
  ./programs/gamescope.nix
  ./programs/gdk-pixbuf.nix
  ./programs/geary.nix
  ./programs/ghidra.nix
  ./programs/git.nix
  ./programs/git-worktree-switcher.nix
  ./programs/gnome-disks.nix
+47 −0
Original line number Diff line number Diff line
{
  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 {
    environment = {
      systemPackages = [ cfg.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(":")]
          end
        '';
      };
    };
  };

  meta.maintainers = with lib.maintainers; [ govanify ];
}