This repository contains a Nix flake for packaging Cursor, an AI-first code editor, for use on NixOS systems.
Cursor is an AI-first code editor designed to enhance productivity through AI-assisted coding. It offers features like code completion, refactoring suggestions, and natural language command processing.
For more information about Cursor, visit the official website.
To install Cursor using this flake, follow these steps:
-
Ensure you have flakes enabled in your NixOS configuration.
-
Add this flake to your
flake.nix
:{ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; # Note that nixos unstable channel is required cursor-flake.url = "github:Rishabh5321/cursor-flake"; }; outputs = { self, nixpkgs, cursor }: { # Your existing configuration... nixosConfigurations.your-hostname = nixpkgs.lib.nixosSystem { # ... modules = [ # Add inputs.cursor-flake.packages.${system}.cursor to your pkgs file ({ pkgs, ... }: { environment.systemPackages = [ inputs.cursor-flake.packages.${system}.cursor ]; }) ]; }; }; }
-
Run
sudo nixos-rebuild switch
to apply the changes. It can also be registered with home manager
After installation, you can launch Cursor from your application menu or by running cursor
in your terminal.
To ensure proper version management and take full advantage of Nix's reproducibility features, we recommend the following:
-
Disable auto-updates in Cursor:
- Open Cursor
- Go to Settings (gear icon) > Updates
- Disable "Automatically download and install updates"
-
Update using Nix: To update Cursor, update the flake input in your
flake.nix
and rebuild your system:nix flake update sudo nixos-rebuild switch
This approach ensures that your Cursor version is managed atomically with the rest of your system, providing better stability and reproducibility.
We welcome contributions to improve this Nix package for Cursor! Here are some ways you can contribute:
- Testing: Try the package on different NixOS configurations and report any issues.
- Documentation: Help improve this README or add wiki pages with tips and tricks.
- Code Improvements: Suggest improvements to the Nix expression or flake configuration.
- Version Updates: Help keep the package up-to-date with the latest Cursor releases.
To contribute:
- Fork this repository
- Create a new branch for your changes
- Make your changes and commit them
- Push to your fork and submit a pull request
This Nix package is distributed under the MIT License. See the LICENSE
file for more information.
Note: While this package is MIT licensed, Cursor itself may have its own licensing terms. Please refer to the Cursor website for details on Cursor's license.
For any questions or issues, please open an issue on the GitHub repository.