Unverified Commit adfec372 authored by Michael Daniels's avatar Michael Daniels Committed by GitHub
Browse files

code-cursor: add mime registration (#507402)

parents 7cd55ea2 83f6805a
Loading
Loading
Loading
Loading
+17 −3
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ let

  source = sources.${hostPlatform.system};
in
buildVscode rec {
(buildVscode rec {
  inherit commandLineArgs useVSCodeRipgrep;
  inherit (sourcesJson) version vscodeVersion;

@@ -58,7 +58,7 @@ buildVscode rec {
  # See https://eclecticlight.co/2022/06/17/app-security-changes-coming-in-ventura/ for more information.
  dontFixup = stdenv.hostPlatform.isDarwin;

  # Cursor has no wrapper script.
  # Cursor ships a launcher script that resolves its own VSCODE_PATH.
  patchVSCodePath = false;

  meta = {
@@ -79,4 +79,18 @@ buildVscode rec {
    ++ lib.platforms.darwin;
    mainProgram = "cursor";
  };
}
}).overrideAttrs
  (oldAttrs: {
    preFixup =
      (oldAttrs.preFixup or "")
      + lib.optionalString hostPlatform.isLinux ''
        sed -i '/^Keywords=/a MimeType=application/x-cursor-workspace;' \
          $out/share/applications/cursor.desktop
      '';
    postInstall =
      (oldAttrs.postInstall or "")
      + lib.optionalString hostPlatform.isLinux ''
        install -Dm644 ../mime/packages/cursor-workspace.xml -t $out/share/mime/packages
        rm -f $out/lib/cursor/resources/appimageupdatetool.AppImage
      '';
  })