{
  appimageTools,
  fetchurl,
  makeWrapper,
  ...
}: let
  pname = "crossover";
  version = "3.1.5";
  src = fetchurl {
    url = "https://github.com/lacymorrow/crossover/releases/download/v${version}/CrossOver-${version}-x86_64.AppImage";
    sha256 = "sha256-64RPal8n1PJh1LB+CTyNFt04Pw1lVgcsyc63S8yQ/DA=";
  };
  appimageContents = appimageTools.extract {
    inherit pname version src;
  };
in
  appimageTools.wrapType2 {
    inherit pname version src;

    nativeBuildInputs = [makeWrapper];
    extraInstallCommands = ''
      wrapProgram $out/bin/${pname} --add-flags "--no-sandbox"

      # Create a minimal .desktop file manually
      mkdir -p $out/share/applications
      cat > $out/share/applications/${pname}.desktop <<EOF
      [Desktop Entry]
      Name=${pname}
      Exec=${pname} %U
      Icon=${pname}
      Type=Application
      Categories=Utility;
      EOF

      # Optionally extract icon from AppImage (if available)
      # You can also manually install an icon here:
      mkdir -p $out/share/icons/hicolor/0x0/apps
      cp ${appimageContents}/usr/share/icons/hicolor/0x0/apps/${pname}.png $out/share/icons/hicolor/0x0/apps/${pname}.png || true
    '';
  }
