Cursor is now available on nixos

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.
3 Likes

I’m not sure how to provide better reporting but would be happy to if I can find out how but the window opens and then nothing happens.

[lazylambda@nixos:~]$ sudo nix-channel --list
nixos https://nixos.org/channels/nixos-24.05
environment.systemPackages = (

  let unstable = import (pkgs.fetchFromGitHub {
        owner="NixOS";
		    repo="nixpkgs";
        rev="1bbe1fee60c10d628efbc639783197d1020c5463";# "ea4c80b39be4c09702b0cb3b42eab59e2ba4f24bs";
       	sha256= "sha256-igwdKMfWCo6pKMldoSKhTsx5QKSM7JXjbK6tCllSzlU=";
	    }) { config = {
             allowUnfree = true;
             overlays = [
               (import (builtins.fetchTarball {
                 url = https://github.com/nix-community/emacs-overlay/archive/master.tar.gz;
               }))
             ];
           };
         };
in
    with pkgs [ <omitted > ] ++
    [ <omitted>
    unstable.code-cursor
    ]
)

This is awesome.

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.

I’m testing this out right now.

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".

No errors, just an empty output.

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.

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
  };
  outputs =
    {
      self,
      nixpkgs,
    }:

    let
      pkgs = import nixpkgs {
        system = "x86_64-linux";
        config = {
          allowUnfree = true;
        };
      };
    in
    with pkgs;
    {
      devShells.x86_64-linux.default = mkShell {
        buildInputs = [
          cargo
          rustc
          SDL2
          alsa-lib.dev
          code-cursor
          pkg-config
        ];

        shellHook = ''
          export PKG_CONFIG_PATH=${pkgs.alsa-lib.dev}/lib/pkgconfig:$PKG_CONFIG_PATH
        '';
      };
    };
}

  1. You’re a rock star.
  2. nativeBuildInputs is for the build system itself. buildInputs are the things to be built.
  3. vscode has a bunch of extra work to make it operate in cases like this. Unfortunately, I don’t have that much time to productionize this package.
  4. Want to be one of the maintainers?
1 Like

FYI, I deleted the backport request. I’m already getting more support requests than I have time for (I’m just a volunteer nixpkgs maintainer).

This can go into the stable channel after we have enough maintainers to field issues.

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.