45 lines
990 B
Nix
45 lines
990 B
Nix
{
|
|
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";
|
|
};
|
|
};
|
|
}
|