aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/hosts/adam/flake-parts.nix8
-rw-r--r--modules/pkgs/fluffy-mod-manager.nix86
-rw-r--r--modules/pkgs/ida-pro-mcp.nix65
-rw-r--r--modules/pkgs/ida-pro.nix198
-rw-r--r--modules/programs/mcp.nix25
-rw-r--r--modules/users/schererleander/hm-linux.nix2
6 files changed, 383 insertions, 1 deletions
diff --git a/modules/hosts/adam/flake-parts.nix b/modules/hosts/adam/flake-parts.nix
index f76dce2..0c35d9f 100644
--- a/modules/hosts/adam/flake-parts.nix
+++ b/modules/hosts/adam/flake-parts.nix
@@ -4,9 +4,15 @@
specialArgs = { inherit inputs; };
modules = with inputs.self.modules.nixos; [
{
- nixpkgs.overlays = [ inputs.nixpkgs-wayland.overlays.default ];
+ nixpkgs.overlays = [
+ inputs.nixpkgs-wayland.overlays.default
+ inputs.self.overlays.ida-pro
+ inputs.self.overlays.ida-pro-mcp
+ inputs.self.overlays.fluffy-mod-manager
+ ];
}
adam
+ ida-pro
home-manager
plymouth
localization
diff --git a/modules/pkgs/fluffy-mod-manager.nix b/modules/pkgs/fluffy-mod-manager.nix
new file mode 100644
index 0000000..d1dfe83
--- /dev/null
+++ b/modules/pkgs/fluffy-mod-manager.nix
@@ -0,0 +1,86 @@
+{ ... }:
+{
+ flake.overlays.fluffy-mod-manager = final: prev: {
+ fluffy-mod-manager = final.callPackage (
+ {
+ lib,
+ stdenv,
+ makeWrapper,
+ wine,
+ requireFile,
+ copyDesktopItems,
+ makeDesktopItem,
+ icoutils,
+ imagemagick,
+ unzip,
+ }:
+ stdenv.mkDerivation rec {
+ pname = "fluffy-mod-manager";
+ version = "3.016";
+
+ src = requireFile {
+ name = "fluffy-mod-manager.zip";
+ url = "https://www.nexusmods.com/residentevil32020/mods/8";
+ sha256 = "071sa9a8dw2zzk3pamhalfn8whzjp8ch3a6wjx6jqgp1g60k6ai6";
+ };
+
+ nativeBuildInputs = [ makeWrapper copyDesktopItems icoutils imagemagick unzip ];
+
+ sourceRoot = ".";
+
+ desktopItems = [
+ (makeDesktopItem {
+ name = "fluffy-mod-manager";
+ exec = "fluffy-mod-manager";
+ icon = "fluffy-mod-manager";
+ desktopName = "Fluffy Mod Manager";
+ categories = [ "Game" ];
+ startupWMClass = "modmanager.exe";
+ })
+ ];
+
+ installPhase = ''
+ runHook preInstall
+
+ mkdir -p $out/share/fluffy-mod-manager
+ cp -r * $out/share/fluffy-mod-manager/
+
+ mkdir -p $out/share/pixmaps
+ EXE_NAME=$(find . -maxdepth 1 -iname "modmanager.exe" -print -quit)
+ if [ -n "$EXE_NAME" ]; then
+ wrestool -x -t 14 -n 105 "$EXE_NAME" -o fluffy.ico || true
+ if [ -f fluffy.ico ]; then
+ magick "fluffy.ico[0]" $out/share/pixmaps/fluffy-mod-manager.png || convert "fluffy.ico[0]" $out/share/pixmaps/fluffy-mod-manager.png || true
+ fi
+ fi
+
+ mkdir -p $out/bin
+
+ makeWrapper ${wine}/bin/wine $out/bin/fluffy-mod-manager \
+ --run "export WINEPREFIX=\"''${WINEPREFIX:-\$HOME/.wine}\"" \
+ --run "mkdir -p \"\$WINEPREFIX/drive_c/FluffyModManager\"" \
+ --run "cp -rn $out/share/fluffy-mod-manager/* \"\$WINEPREFIX/drive_c/FluffyModManager/\"" \
+ --run "chmod -R +w \"\$WINEPREFIX/drive_c/FluffyModManager\"" \
+ --run "cd \"\$WINEPREFIX/drive_c/FluffyModManager\"" \
+ --add-flags "Modmanager.exe"
+
+ runHook postInstall
+ '';
+
+ meta = with lib; {
+ description = "Mod manager for many Capcom games and others";
+ homepage = "https://www.fluffymanager.com/";
+ license = licenses.unfree;
+ platforms = platforms.linux;
+ };
+ }
+ ) {
+ # Use Wow64 package to ensure 64-bit prefix compatibility
+ wine = final.wineWow64Packages.waylandFull;
+ };
+ };
+
+ flake.modules.homeManager.fluffy-mod-manager = { pkgs, ... }: {
+ home.packages = [ pkgs.fluffy-mod-manager ];
+ };
+}
diff --git a/modules/pkgs/ida-pro-mcp.nix b/modules/pkgs/ida-pro-mcp.nix
new file mode 100644
index 0000000..73a5a3e
--- /dev/null
+++ b/modules/pkgs/ida-pro-mcp.nix
@@ -0,0 +1,65 @@
+{ ... }:
+{
+ flake.overlays.ida-pro-mcp = final: prev: {
+ idapro = final.python313.pkgs.buildPythonPackage rec {
+ pname = "idapro";
+ version = "0.0.9";
+
+ pyproject = true;
+
+ src = final.fetchPypi {
+ inherit pname version;
+ hash = "sha256-igQ6ic5QdTPlAuj2WBpPtYut4l6PpgSVRbeexjZ5LjU=";
+ };
+
+ build-system = [
+ final.python313.pkgs.setuptools
+ ];
+
+ doCheck = false;
+
+ meta = with final.lib; {
+ description = "IDA Library Python module";
+ license = licenses.mit;
+ platforms = platforms.all;
+ };
+ };
+
+ ida-pro-mcp = final.python313.pkgs.buildPythonApplication rec {
+ pname = "ida-pro-mcp";
+ version = "2.0.0";
+
+ pyproject = true;
+
+ src = final.fetchFromGitHub {
+ owner = "mrexodia";
+ repo = "ida-pro-mcp";
+ rev = "main";
+ hash = "sha256-NkZVtKj4zvUSdEpQxH+/2k2LZrqK322G64jSVAroHaE=";
+ };
+
+ build-system = [
+ final.python313.pkgs.setuptools
+ ];
+
+ dependencies = [
+ final.idapro
+ final.python313.pkgs.tomli-w
+ ];
+
+ pythonImportsCheck = [
+ "ida_pro_mcp"
+ ];
+
+ doCheck = false;
+
+ meta = with final.lib; {
+ description = "IDA Pro MCP server";
+ homepage = "https://github.com/mrexodia/ida-pro-mcp";
+ license = licenses.mit;
+ mainProgram = "ida-pro-mcp";
+ platforms = platforms.all;
+ };
+ };
+ };
+}
diff --git a/modules/pkgs/ida-pro.nix b/modules/pkgs/ida-pro.nix
new file mode 100644
index 0000000..0a680d2
--- /dev/null
+++ b/modules/pkgs/ida-pro.nix
@@ -0,0 +1,198 @@
+{ ... }:
+{
+ flake.overlays.ida-pro = final: prev: {
+ ida-pro = final.callPackage (
+ {
+ autoPatchelfHook,
+ cairo,
+ copyDesktopItems,
+ curl,
+ dbus,
+ fontconfig,
+ freetype,
+ glib,
+ gtk3,
+ lib,
+ libGL,
+ libdrm,
+ libice,
+ libkrb5,
+ libsecret,
+ libsm,
+ libunwind,
+ libx11,
+ libxau,
+ libxcb,
+ libxcrypt-legacy,
+ libxext,
+ libxi,
+ libxkbcommon,
+ libxrender,
+ libxcb-image,
+ libxcb-keysyms,
+ libxcb-render-util,
+ libxcb-wm,
+ makeDesktopItem,
+ makeWrapper,
+ openssl,
+ patchelf,
+ perl,
+ python313,
+ qt6,
+ requireFile,
+ stdenv,
+ zlib,
+ }:
+ let
+ pythonForIDA = python313.withPackages (ps: with ps; [ rpyc ]);
+
+ src = requireFile {
+ name = "ida-pro_93_x64linux.run";
+ url = "https://my.hex-rays.com/";
+ sha256 = "a64e6589feeca0f4e1bfb962d1a283761fb38c5158f5f82c8f1e7ddf32f69850";
+ };
+
+ libida = requireFile {
+ name = "libida.so";
+ url = "https://my.hex-rays.com/";
+ sha256 = "86cff5a0dbf26eb56076313181e9ca8e7db48212d60d00588217cfac36060531";
+ };
+
+ libida32 = requireFile {
+ name = "libida32.so";
+ url = "https://my.hex-rays.com/";
+ sha256 = "55afb0edcec85139b99cb36c80d460ab7679c87e50bf4d5b111f7910935e69c2";
+ };
+
+ runtimeDependencies = [
+ cairo
+ dbus
+ fontconfig
+ freetype
+ glib
+ gtk3
+ libdrm
+ libGL
+ libkrb5
+ libsecret
+ qt6.qtbase
+ qt6.qtwayland
+ libunwind
+ libxkbcommon
+ openssl.out
+ stdenv.cc.cc
+ libice
+ libsm
+ libx11
+ libxau
+ libxcb
+ libxcrypt-legacy
+ libxext
+ libxi
+ libxrender
+ libxcb-image
+ libxcb-keysyms
+ libxcb-render-util
+ libxcb-wm
+ zlib
+ curl.out
+ pythonForIDA
+ ];
+ in
+ stdenv.mkDerivation rec {
+ pname = "ida-pro";
+ version = "9.3";
+
+ inherit src;
+
+ desktopItem = makeDesktopItem {
+ name = "ida-pro";
+ exec = "ida";
+ icon = "ida-pro";
+ comment = meta.description;
+ desktopName = "IDA Pro";
+ genericName = "Interactive Disassembler";
+ categories = [ "Development" ];
+ startupWMClass = "IDA";
+ };
+
+ desktopItems = [ desktopItem ];
+
+ nativeBuildInputs = [
+ makeWrapper
+ copyDesktopItems
+ autoPatchelfHook
+ qt6.wrapQtAppsHook
+ perl
+ patchelf
+ ];
+
+ buildInputs = runtimeDependencies;
+
+ dontUnpack = true;
+ dontWrapQtApps = true;
+
+ installPhase = ''
+ runHook preInstall
+
+ mkdir -p "$out/bin" "$out/lib" "$out/opt" "$out/share/pixmaps"
+
+ IDADIR="$out/opt"
+ HOME="$out/opt"
+
+ $(cat "$NIX_CC/nix-support/dynamic-linker") "$src" \
+ --mode unattended --debuglevel 4 --prefix "$IDADIR" || true
+
+ install -m 0644 "${libida}" "$IDADIR/libida.so"
+ install -m 0644 "${libida32}" "$IDADIR/libida32.so"
+
+ for libFile in "$IDADIR"/*.so "$IDADIR"/*.so.6; do
+ ln -s "$libFile" "$out/lib/$(basename "$libFile")"
+ done
+
+ patchelf --add-needed libpython3.13.so "$out/lib/libida.so"
+ patchelf --add-needed libcrypto.so "$out/lib/libida.so"
+ patchelf --add-needed libsecret-1.so.0 "$out/lib/libida.so"
+
+ addAutoPatchelfSearchPath "$IDADIR"
+
+ if [ -f "$IDADIR/appico.png" ]; then
+ ln -s "$IDADIR/appico.png" "$out/share/pixmaps/ida-pro.png"
+ fi
+
+ wrapProgram "$IDADIR/ida" \
+ --prefix IDADIR : "$IDADIR" \
+ --prefix QT_PLUGIN_PATH : "$IDADIR/plugins/platforms" \
+ --prefix PYTHONPATH : "$out/bin/idalib/python" \
+ --prefix PATH : "${pythonForIDA}/bin:$IDADIR" \
+ --prefix LD_LIBRARY_PATH : "$out/lib"
+
+ ln -s "$IDADIR/ida" "$out/bin/ida"
+
+ runHook postInstall
+ '';
+
+ meta = with lib; {
+ description = "IDA Pro";
+ homepage = "https://hex-rays.com/ida-pro/";
+ license = licenses.unfree;
+ mainProgram = "ida";
+ platforms = [ "x86_64-linux" ];
+ sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+ };
+ }
+ ) { };
+ };
+
+ flake.modules.nixos.ida-pro =
+ { pkgs, ... }:
+ {
+ environment.systemPackages = [ pkgs.ida-pro ];
+ };
+
+ flake.modules.homeManager.ida-pro =
+ { pkgs, ... }:
+ {
+ home.packages = [ pkgs.ida-pro ];
+ };
+}
diff --git a/modules/programs/mcp.nix b/modules/programs/mcp.nix
new file mode 100644
index 0000000..e6b5823
--- /dev/null
+++ b/modules/programs/mcp.nix
@@ -0,0 +1,25 @@
+{
+ flake.modules.homeManager.mcp =
+ { pkgs, ... }:
+ let
+ pluginRoot = "${pkgs.ida-pro-mcp}/${pkgs.python313.sitePackages}/ida_pro_mcp";
+ in
+ {
+ home = {
+ packages = [ pkgs.ida-pro-mcp ];
+ file = {
+ ".idapro/plugins/ida_mcp.py".source = "${pluginRoot}/ida_mcp.py";
+ ".idapro/plugins/ida_mcp".source = "${pluginRoot}/ida_mcp";
+ };
+ };
+
+ programs.mcp = {
+ enable = true;
+ servers = {
+ "ida-pro-mcp" = {
+ url = "http://127.0.0.1:13337/mcp";
+ };
+ };
+ };
+ };
+}
diff --git a/modules/users/schererleander/hm-linux.nix b/modules/users/schererleander/hm-linux.nix
index 52bf07d..90deb75 100644
--- a/modules/users/schererleander/hm-linux.nix
+++ b/modules/users/schererleander/hm-linux.nix
@@ -11,6 +11,8 @@
jellyfin-desktop
libreoffice
wine
+ mcp
+ fluffy-mod-manager
];
};
}