Auto-updating Nix Flake packaging for Cursor.
This flake provides Cursor for NixOS systems with:
- Automated updates: API-based version detection with 3x weekly checks
- Multi-platform support: Linux (x86_64, aarch64) and macOS (x86_64, aarch64)
- Chrome integration (Linux only): Bundled browser for testing frameworks
- FHS environment: Standard Linux filesystem layout via AppImage extraction
- Version pinning: Tagged releases for reproducible builds
- Zero configuration: Browser automation works out of the box on Linux
nix run github:jacopone/code-cursor-nixAdd to your flake.nix:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
code-cursor-nix.url = "github:jacopone/code-cursor-nix";
};
outputs = { self, nixpkgs, code-cursor-nix, ... }: {
nixosConfigurations.your-hostname = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{
environment.systemPackages = [
code-cursor-nix.packages.x86_64-linux.cursor
];
}
];
};
};
}{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
code-cursor-nix.url = "github:jacopone/code-cursor-nix";
};
outputs = { self, nixpkgs, home-manager, code-cursor-nix, ... }: {
homeConfigurations.your-user = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [
{
home.packages = [
code-cursor-nix.packages.x86_64-linux.cursor
];
}
];
};
};
}Launch from application menu or command line:
cursorUse tagged releases for stability:
# Latest release (recommended)
inputs.code-cursor-nix.url = "github:jacopone/code-cursor-nix";
# Specific version
inputs.code-cursor-nix.url = "github:jacopone/code-cursor-nix/v2.0.34";View all releases: https://github.com/jacopone/code-cursor-nix/releases
# Update flake lock
nix flake update code-cursor-nix
# Rebuild system
sudo nixos-rebuild switch --flake .Cursor is distributed as an AppImage that expects a standard Linux filesystem layout. The packaging process:
- AppImage extraction: Extracts upstream AppImage without modification
- FHS Environment: Wraps binary in isolated container with standard paths and required libraries
- Chrome integration (Linux): Bundles Google Chrome for browser automation frameworks
The flake implements automated version tracking:
- Scheduled checks: GitHub Actions runs Monday, Wednesday, Friday at 9:00 UTC
- API-based detection: Queries Cursor's official API at
https://api2.cursor.sh/updates/api/download/stable/{platform}/cursor - Hash verification: Downloads and verifies hashes for all platforms
- Build testing: Validates package builds successfully before creating PR
- Auto-merge: Merges PR when tests pass
- Release tagging: Creates GitHub releases for version pinning
On Linux systems, Chrome is bundled in the FHS environment for testing frameworks:
- Sets
CHROME_BINandCHROME_PATHenvironment variables - Enables Playwright, Puppeteer, and Selenium without additional configuration
- Chrome remains isolated within Cursor's environment
Note: Browser automation support is Linux-only. macOS users need to install Chrome separately.
Example usage:
// Playwright - works immediately
const { chromium } = require('playwright');
const browser = await chromium.launch();
// Puppeteer - no configuration needed
const puppeteer = require('puppeteer');
const browser = await puppeteer.launch();- NixOS or Nix package manager with flakes enabled
allowUnfree = truein Nix configuration (Cursor is proprietary software)
NixOS Configuration (configuration.nix):
nixpkgs.config.allowUnfree = true;Flakes (flake.nix):
nixpkgs = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
};Upstream binary changed. Update with:
./scripts/update-version.shOr wait for automatic update (runs 3x weekly).
Verify unfree packages are enabled:
nix-instantiate --eval -E '(import <nixpkgs> {}).config.allowUnfree'Should return true.
Verify Chrome environment variables are set:
echo $CHROME_BIN
echo $CHROME_PATHBoth should point to the Chrome binary. If empty, the FHS environment may not be configured correctly.
macOS users: Browser automation requires separate Chrome installation.
Cursor's API may be temporarily unavailable or rate-limiting:
- Wait a few minutes and retry
- Check https://cursor.com/changelog for latest version
- Automatic workflow will retry on next scheduled run
To manually trigger an update:
# Clone repository
git clone https://github.com/jacopone/code-cursor-nix
cd code-cursor-nix
# Run update script
./scripts/update-version.sh
# Test build
nix build .#cursorcode-cursor-nix/
├── flake.nix # Main flake configuration with overlay
├── package.nix # Package derivation with FHS + Chrome
├── scripts/
│ └── update-version.sh # Auto-update script
└── .github/
└── workflows/
├── update.yml # Auto-update workflow (3x weekly)
├── release.yml # Automatic release tagging
└── cleanup-branches.yml # Branch cleanup
Contributions welcome. Please:
- Fork repository
- Create feature branch
- Test with
nix build .#cursorandnix flake check - Submit pull request
MIT License - see LICENSE for details.
Cursor is proprietary software. This repository provides Nix packaging only.
- antigravity-nix - Auto-updating Google Antigravity
- claude-code-nix - Auto-updating Claude Code CLI
- nixpkgs - Official Nix packages collection