Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package request: code-cursor #309541

Open
Anifyuli opened this issue May 6, 2024 · 5 comments
Open

Package request: code-cursor #309541

Anifyuli opened this issue May 6, 2024 · 5 comments

Comments

@Anifyuli
Copy link

Anifyuli commented May 6, 2024

Project description
This is Code OSS fork with builtin AI code generator

Metadata


Add a 👍 reaction to issues you find important.

@gebeer
Copy link

gebeer commented May 13, 2024

They only distribute cursor editor as Appimage. It would really be great to have this packaged for Nix.
The Appimage is updated very frequently. So the nix package name should include the version number, sth like cursor-0.33

@haras-unicorn
Copy link

pkgs.appimageTools.wrapType2 {
          pname = "cursor";
          version = "0.1.0";

          src = pkgs.fetchurl {
            url = "https://downloader.cursor.sh/linux/appImage/x64";
            hash = "sha256-Fsy9OVP4vryLHNtcPJf0vQvCuu4NEPDTN2rgXO3Znwo=";
          };
        }

heres a start if u wanna try it
if it complains change the hash to the thing it expects
idk if there are versioned urls for this thing so that the hash is not a problem

on another note this thing is so slow
like no extensions (except the builtin vim mode) and it is slow and stutters on my machine and idk why
vscode works fast compared to it
but idk mby im doing something wrong

@gebeer
Copy link

gebeer commented Jun 18, 2024

pkgs.appimageTools.wrapType2 {
          pname = "cursor";
          version = "0.1.0";

          src = pkgs.fetchurl {
            url = "https://downloader.cursor.sh/linux/appImage/x64";
            hash = "sha256-Fsy9OVP4vryLHNtcPJf0vQvCuu4NEPDTN2rgXO3Znwo=";
          };
        }

heres a start if u wanna try it if it complains change the hash to the thing it expects idk if there are versioned urls for this thing so that the hash is not a problem

on another note this thing is so slow like no extensions (except the builtin vim mode) and it is slow and stutters on my machine and idk why vscode works fast compared to it but idk mby im doing something wrong

Thank you for the suggestion.

I've gone another route to avoid the hash thing because the AppImage is being updated quite frequently.
I have a module cursor.nix with a shell script:

{pkgs, homeDir ? pkgs.lib.getHome} :
pkgs.writeShellScriptBin "cursor" ''
    # Find the latest cursor AppImage in ~/Applications
    echo "Home Directory: ${homeDir}"
    cursor_app="$(find ${homeDir}/Applications -maxdepth 1 -name 'cursor*.AppImage' | sort | tail -n 1)"
    if [[ -f "$cursor_app" ]]; then
        # Execute the AppImage if found
        appimage-run "$cursor_app" "$@"
    else
        echo "Cursor AppImage not found or not executable in ~/Applications."
        exit 1
    fi
''

and in my packages.nix I install it:

    (callPackage ./shellscripts/cursor.nix {
      # inherit pkgs;
      homeDir = "${homeDir}";
    })

When I get prompted for an update in the cursor app, I download the latest AppImage and the shell script takes care of the rest.
Still a manual download step involved. But imo better than having to rebuild twice because of the hash error.

@haras-unicorn
Copy link

pkgs.appimageTools.wrapType2 {
          pname = "cursor";
          version = "0.1.0";

          src = pkgs.fetchurl {
            url = "https://downloader.cursor.sh/linux/appImage/x64";
            hash = "sha256-Fsy9OVP4vryLHNtcPJf0vQvCuu4NEPDTN2rgXO3Znwo=";
          };
        }

heres a start if u wanna try it if it complains change the hash to the thing it expects idk if there are versioned urls for this thing so that the hash is not a problem
on another note this thing is so slow like no extensions (except the builtin vim mode) and it is slow and stutters on my machine and idk why vscode works fast compared to it but idk mby im doing something wrong

Thank you for the suggestion.

I've gone another route to avoid the hash thing because the AppImage is being updated quite frequently. I have a module cursor.nix with a shell script:

{pkgs, homeDir ? pkgs.lib.getHome} :
pkgs.writeShellScriptBin "cursor" ''
    # Find the latest cursor AppImage in ~/Applications
    echo "Home Directory: ${homeDir}"
    cursor_app="$(find ${homeDir}/Applications -maxdepth 1 -name 'cursor*.AppImage' | sort | tail -n 1)"
    if [[ -f "$cursor_app" ]]; then
        # Execute the AppImage if found
        appimage-run "$cursor_app" "$@"
    else
        echo "Cursor AppImage not found or not executable in ~/Applications."
        exit 1
    fi
''

and in my packages.nix I install it:

    (callPackage ./shellscripts/cursor.nix {
      # inherit pkgs;
      homeDir = "${homeDir}";
    })

When I get prompted for an update in the cursor app, I download the latest AppImage and the shell script takes care of the rest. Still a manual download step involved. But imo better than having to rebuild twice because of the hash error.

yea makes sense - im not using it actively and just wanted to quickly check it out

@pective
Copy link

pective commented Aug 22, 2024

any updates on this? i cant for the love of god get a desktop entry working with the appimage </3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants