add programs.idapro
This commit is contained in:
parent
cf817800f5
commit
fda38bd2cf
20
README.md
20
README.md
|
@ -336,6 +336,26 @@ example:
|
||||||
|
|
||||||
enable binsync integration
|
enable binsync integration
|
||||||
|
|
||||||
|
### [`programs.idapro`](./modules/idapro/default.nix)
|
||||||
|
|
||||||
|
Enables IDA Pro in the system environment, with optional plugin config.
|
||||||
|
|
||||||
|
This also directs IDA Pro to use `~/.config/idapro` as its main user config directory, instead of
|
||||||
|
`~/.idapro`. Unfortunately, as of IDA Pro 9.2, `~/.idapro` still gets created, though it will be
|
||||||
|
empty.
|
||||||
|
|
||||||
|
#### `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)
|
### [`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
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
imports = [
|
imports = [
|
||||||
./modules/ghidra-client
|
./modules/ghidra-client
|
||||||
./modules/ghidra-server
|
./modules/ghidra-server
|
||||||
|
./modules/idapro
|
||||||
./modules/machine-info
|
./modules/machine-info
|
||||||
./modules/regdom
|
./modules/regdom
|
||||||
./modules/satisfactory-dedicated-server
|
./modules/satisfactory-dedicated-server
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.programs.idapro;
|
||||||
|
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
|
||||||
|
];
|
||||||
|
|
||||||
|
sessionVariables.IDAUSR = "$HOME/.config/idapro";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -26,7 +26,7 @@
|
||||||
curl,
|
curl,
|
||||||
gnutar,
|
gnutar,
|
||||||
makeDesktopItem,
|
makeDesktopItem,
|
||||||
makeWrapper,
|
makeBinaryWrapper,
|
||||||
runCommand,
|
runCommand,
|
||||||
|
|
||||||
_errorMessage ? builtins.throw ''
|
_errorMessage ? builtins.throw ''
|
||||||
|
@ -62,6 +62,8 @@
|
||||||
pythonPackage ? python311,
|
pythonPackage ? python311,
|
||||||
# additional python packages to make available to idapython
|
# additional python packages to make available to idapython
|
||||||
pythonDeps ? [],
|
pythonDeps ? [],
|
||||||
|
# dirs to prepend to IDAUSR
|
||||||
|
plugins ? [],
|
||||||
}: let
|
}: let
|
||||||
defaultPythonDeps = ps: with ps; [
|
defaultPythonDeps = ps: with ps; [
|
||||||
rpyc
|
rpyc
|
||||||
|
@ -77,7 +79,7 @@ in stdenv.mkDerivation (self: {
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
autoPatchelfHook
|
autoPatchelfHook
|
||||||
copyDesktopItems
|
copyDesktopItems
|
||||||
makeWrapper
|
makeBinaryWrapper
|
||||||
];
|
];
|
||||||
|
|
||||||
# Add everything to the RPATH, in case IDA decides to dlopen things.
|
# Add everything to the RPATH, in case IDA decides to dlopen things.
|
||||||
|
@ -149,7 +151,8 @@ in stdenv.mkDerivation (self: {
|
||||||
|
|
||||||
wrapProgram "$out/opt/ida" \
|
wrapProgram "$out/opt/ida" \
|
||||||
--prefix PYTHONPATH : $out/opt/idalib/python \
|
--prefix PYTHONPATH : $out/opt/idalib/python \
|
||||||
--prefix PATH : ${pythonEnv}/bin
|
--prefix PATH : ${pythonEnv}/bin \
|
||||||
|
--suffix IDAUSR : "${lib.makeSearchPath "" plugins}"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
dontWrapQtApps = true;
|
dontWrapQtApps = true;
|
||||||
|
|
Loading…
Reference in New Issue