code-cursor: add mime registration (#507402)

This commit is contained in:
Michael Daniels
2026-04-18 17:51:56 +00:00
committed by GitHub
+17 -3
View File
@@ -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
'';
})