From 4b6fd48e04685d3fc109facb9b7b65bfc2b16778 Mon Sep 17 00:00:00 2001 From: xenia Date: Fri, 12 Sep 2025 02:14:30 -0400 Subject: [PATCH] add programs.idapro --- README.md | 16 ++++++++ module.nix | 1 + modules/idapro/default.nix | 42 ++++++++++++++++++++ pkgs/reverse-engineering/idapro9/default.nix | 2 + 4 files changed, 61 insertions(+) create mode 100644 modules/idapro/default.nix diff --git a/README.md b/README.md index 3c1f8cc..9405ef3 100644 --- a/README.md +++ b/README.md @@ -336,6 +336,22 @@ example: enable binsync integration +### [`programs.idapro`](./modules/idapro/default.nix) + +Enables IDA Pro in the system environment, with optional plugin config. + +#### `programs.idapro.enable` + +Whether to enable IDA Pro + +#### `programs.idapro.package` + +The IDA Pro package to use + +#### `programs.idapro.binsync.enable` + +Enables binsync integration with IDA Pro + ### [`environment.machineInfo`](./modules/machine-info/default.nix) provides options to customize the `/etc/machine-info` file on a NixOS system. See the module itself diff --git a/module.nix b/module.nix index e39085a..82f488d 100644 --- a/module.nix +++ b/module.nix @@ -2,6 +2,7 @@ imports = [ ./modules/ghidra-client ./modules/ghidra-server + ./modules/idapro ./modules/machine-info ./modules/regdom ./modules/satisfactory-dedicated-server diff --git a/modules/idapro/default.nix b/modules/idapro/default.nix new file mode 100644 index 0000000..45a0bd6 --- /dev/null +++ b/modules/idapro/default.nix @@ -0,0 +1,42 @@ +{ + config, + lib, + pkgs, + ... +}: + +let + cfg = config.programs.idapo; + binsyncPkg = pkgs.python311.pkgs.binsync; + binsyncPath = "${pkgs.python311.pkgs.binsync}/${pkgs.python311.sitePackages}"; + idaproConfigured = cfg.package.override { + pythonDeps = lib.optionals cfg.binsync.enable [binsyncPkg]; + plugins = lib.optionals cfg.binsync.enable [ + (pkgs.runCommand "binsync-ida" {} '' + mkdir -p $out/plugins + cp ${binsyncPath}/binsync/binsync_plugin.py $out/plugins + '') + ]; + }; +in +{ + options.programs.idapro = { + enable = lib.mkEnableOption "IDA Pro"; + + package = lib.mkPackageOption pkgs "idapro" { + example = lib.literalExpression "idapro.override { ... }"; + }; + + binsync = { + enable = lib.mkEnableOption "IDA binsync integration"; + }; + }; + + config = lib.mkIf cfg.enable { + environment = { + systemPackages = [ + idaproConfigured + ]; + }; + }; +} diff --git a/pkgs/reverse-engineering/idapro9/default.nix b/pkgs/reverse-engineering/idapro9/default.nix index c931630..1c5b3ef 100644 --- a/pkgs/reverse-engineering/idapro9/default.nix +++ b/pkgs/reverse-engineering/idapro9/default.nix @@ -62,6 +62,8 @@ pythonPackage ? python311, # additional python packages to make available to idapython pythonDeps ? [], + # dirs to prepend to IDAUSR + plugins ? [], }: let defaultPythonDeps = ps: with ps; [ rpyc