Skip to content
This repository was archived by the owner on Dec 2, 2025. It is now read-only.

Commit 75f725c

Browse files
committed
Fix native module packaging for Windows
Closes #4
1 parent 108928d commit 75f725c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

flake.nix

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,17 @@
5050
cp -R ${cursorSrc}/resources/app/*.json ${root}/resources/app/
5151
cp -R ${cursorSrc}/resources/app/extensions/cursor-* ${root}/resources/app/extensions/
5252
rm -rf "${root}/resources/app/node_modules"{,.asar}
53-
cp -R ${cursorSrc}/resources/app/node_modules.asar ${root}/resources/app/
53+
54+
# Unpack the Cursor node_modules.asar
55+
${pkgs.asar}/bin/asar extract ${cursorSrc}/resources/app/node_modules.asar ${root}/resources/app/node_modules
56+
# Copy the VS Code native modules into the Cursor node_modules.
57+
# If we don't do this, then native modules will fail.
58+
# See: https://github.com/coder/cursor-arm/issues/4
59+
cp -R ${root}/resources/app/node_modules.asar.unpacked/* ${root}/resources/app/node_modules/
60+
# Repackage the combined contents into a new node_modules.asar
61+
${pkgs.asar}/bin/asar pack ${root}/resources/app/node_modules ${root}/resources/app/node_modules.asar
62+
rm -rf "${root}/resources/app/node_modules"{,.asar.unpacked}
63+
5464
rm -rf ${root}/resources/app/resources
5565
cp -R ${cursorSrc}/resources/app/resources ${root}/resources/app/
5666
'';

0 commit comments

Comments
 (0)