I’ve added cursor to nixpkgs-unstable as code-cursor. You can find it in the nixpkgs search.
Caveats:
Linux-only. Cursor is packaged as an AppImage and requires a FHS environment which won’t work on Darwin. (You’re better off with the official release binaries from here on Darwin and Windows).
Updates will lag the official cursor releases. There’s an update bot (or someone can update manually), plus time for approval, merging, and going through Hydra.
Bugs in the app? Please report them here.
Need an update? Open a packaging request or submit a PR to update. We won’t bite, promise.
Does anyone know how to use Cursor with a flake dev environment? I expect to be able to do nix develop cursor .
This works with VS Code but not Cursor. Right now I can’t use Cursor for development unless I install everything globally which is really annoying. There might be a simple fix for this but I’m a Nix novice and haven’t been able to figure one out.
If you could do me a favor, please run nix flake check flake.nix --impure and let me know if you see any errors such as " error: attribute ‘code-cursor’ missing".
I need additional maintainers on the package. Until then, expect minimal support and updates.
Extra maintainers would also expedite getting new releases sooner, keeping it backported, etc. I get pushback from reviewers over it being an unfree package and that delays new commits.
P.S. In an ideal world, the cursor people would maintain the derivation. I’m happy to walk them through getting started.
I got it working. I needed to move everything into buildInputs instead of having some things in nativeBuildInputs. I’m still not sure why VS Code worked without this change though.
Having run into a similar issue with logseq recently (also packaged as an AppImage), I suspect the problem is a mismatch between the packages available in 24.05 and the ones needed by cursor.
Hi! I’m an amateur Nix/NixOS user and interested potential Cursor user. I currently use VSCodium, and within that package I have the ability to declaratively specify which extensions to install. Cursor has an auto-import-from-VSCode feature, but - as I expected - that doesn’t work for VSCode installed under Nix.
I’m not expert enough to know for sure, but it seems like declarative configuration of extensions is not currently possible with Cursor. Is that a correct understanding?
I would be interested to explore contributing a fix for this if there is a viable strategy for appimages within Nix, I just don’t know how to go about it yet.
Yes, you’re correct. Extensions live in this weird liminal space where they can be downloaded, automatically patched, and executed; they still work on Cursor they way they would on a generic Linux.
Making declarative configuration work could be tricky. For vscode, python, etc. extensions/packages are compiled against their base package and it generates a new binary.
Could that be done with an AppImage? Possibly. An AppImage contains a binary executable and a read-only filesystem via squishfs. The usual nixos build unpacks the app image, mounts the r/o filesystem, copies some files into $out to match desktop expectations, patches the executable, then packs it all up again. (Note: This only applies to Linux. Cursor ships disk image files for Darwin and I haven’t looked at that repackaging process yet.)
The big question is: where do the extensions live? If they live in the filesystem portion (likely), we’d have to unpack, modify, and repack the filesystem part. We have someone exploring that idea to patch a long-standing display error on gtk-based desktops.
I’m sorry there’s no easy answer. If you choose to try it, make sure you have an account on the Discord as well as on Matrix (chat). If you file a PR, I’m the maintainer for code-cursor and I’m happy to help you through the process.
P.S. If you decide to try this, create a new derivation such as code-cursor-with-extensions and inherit the desired sources from code-cursor.