From f47914228e60248ec1381ecdc0e088ccb3d7ca01 Mon Sep 17 00:00:00 2001 From: Josh Heinrichs Date: Thu, 10 Apr 2025 14:02:23 -0600 Subject: [PATCH] code-cursor: fix passing arg to cli on darwin Currently if you try to pass arguments to cursor on the cli on Darwin, it just opens the app instead of respecting arguments like -h. This takes cues from how vscode is packaged and symlinks to the app's bin rather than creating an app wrapper. --- pkgs/by-name/co/code-cursor/package.nix | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pkgs/by-name/co/code-cursor/package.nix b/pkgs/by-name/co/code-cursor/package.nix index f601b788fa6d..de3b52183ae3 100644 --- a/pkgs/by-name/co/code-cursor/package.nix +++ b/pkgs/by-name/co/code-cursor/package.nix @@ -167,15 +167,10 @@ stdenvNoCC.mkDerivation { ${lib.optionalString hostPlatform.isDarwin '' APP_DIR="$out/Applications" - CURSOR_APP="$APP_DIR/Cursor.app" mkdir -p "$APP_DIR" cp -Rp Cursor.app "$APP_DIR" mkdir -p "$out/bin" - cat << EOF > "$out/bin/cursor" - #!${stdenvNoCC.shell} - open -na "$CURSOR_APP" --args "\$@" - EOF - chmod +x "$out/bin/cursor" + ln -s "$APP_DIR/Cursor.app/Contents/Resources/app/bin/cursor" "$out/bin/cursor" ''} runHook postInstall