一键导入
cursor-setup
Cursor AI-powered editor setup and configuration on NixOS including AppImage extraction, version updates, cursor-agent patching, and troubleshooting
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Cursor AI-powered editor setup and configuration on NixOS including AppImage extraction, version updates, cursor-agent patching, and troubleshooting
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Step-by-step installation guide for Nix and dotfiles setup including nix.conf configuration, channel updates, home-manager, and nix-darwin
スキルのプロンプト品質を評価・チューニングする。スキルを書いたあと別のサブエージェントに実行させ、不明瞭点・自動補完箇所・達成率をレポートさせて反復改善する。Use when you want to evaluate or tune a SKILL.md prompt quality. Ref: https://zenn.dev/mizchi/articles/empirical-prompt-tuning
Generate professional English commit messages with gitmoji based on git diff. Use when creating commit messages, analyzing staged changes, or formatting commits according to conventional commits + gitmoji style.
Generate professional English commit messages with gitmoji based on git diff. Use when creating commit messages, analyzing staged changes, or formatting commits according to conventional commits + gitmoji style.
NPM tools and package management using mise including commitizen, cz-git, and global package configuration
System services configuration guide including AeroSpace, JankyBorders, and AltTab on macOS
| name | cursor-setup |
| description | Cursor AI-powered editor setup and configuration on NixOS including AppImage extraction, version updates, cursor-agent patching, and troubleshooting |
Cursor is an AI-powered code editor built on VSCode. On NixOS, we use a custom package that extracts and patches the AppImage to work properly with the NixOS environment.
Cursor is installed via the NixOS system configuration:
# nixos/configuration.nix
environment.systemPackages = with pkgs; [
(pkgs.callPackage ./packages/cursor/extracted.nix { })
];
Visit the Cursor Downloads page or check the changelog for the latest version.
Edit nixos/packages/cursor/extracted.nix:
let
pname = "cursor";
version = "1.6.45"; # Update this version number
src = fetchurl {
url = "https://downloads.cursor.com/production/COMMIT_HASH/linux/x64/Cursor-${version}-x86_64.AppImage";
hash = "sha256-PLACEHOLDER"; # This will be updated in the next step
};
Finding the download URL:
https://downloads.cursor.com/production/{commit}/linux/x64/Cursor-{version}-x86_64.AppImageUse nix-prefetch-url to download and calculate the hash:
# Download and get SHA256 hash
nix-prefetch-url https://downloads.cursor.com/production/COMMIT_HASH/linux/x64/Cursor-1.6.45-x86_64.AppImage
# Convert to SRI format (sha256-...)
nix --extra-experimental-features 'nix-command' hash convert --hash-algo sha256 --to sri HASH_FROM_ABOVE
Update the hash field in extracted.nix with the SRI format hash (e.g., sha256-ABC123...=).
# Build the new package
sudo nixos-rebuild switch --flake .#desktop
# Or for testing without system changes
nix build .#nixosConfigurations.desktop.config.environment.systemPackages -L
cursor --version
The Cursor package includes an automatic patcher for the cursor-agent node binaries. This is necessary because Cursor downloads its own Node.js binaries to ~/.local/share/cursor-agent/versions/, which are dynamically linked and won't work on NixOS without patching.
How it works:
node binary:
.patched marker file to avoid re-patchingLocation: nixos/packages/cursor/extracted.nix:130-161
If cursor-agent fails to run, you can manually patch the node binary:
# Get the NixOS dynamic linker path
INTERPRETER=$(nix --extra-experimental-features 'nix-command flakes' eval --raw 'nixpkgs#stdenv.cc.bintools.dynamicLinker')
# Get the library path
LIBPATH=$(nix --extra-experimental-features 'nix-command flakes' eval --raw 'nixpkgs#stdenv.cc.cc.lib.outPath')/lib
# Patch the binary
nix --extra-experimental-features 'nix-command flakes' run nixpkgs#patchelf -- \
--set-interpreter "$INTERPRETER" \
--set-rpath "$LIBPATH" \
~/.local/share/cursor-agent/versions/*/node
Could not start dynamically linked executableError message:
Could not start dynamically linked executable: /home/user/.local/share/cursor-agent/versions/.../node
NixOS cannot run dynamically linked executables intended for generic linux environments out of the box.
Solution:
.patched marker file exists in the cursor-agent version directory.patched file and restart Cursor to trigger re-patching/nix/store/.../bin/cursormakeCWrapper: Unknown argument --runThis error occurred in older versions when using makeWrapper --run. The current implementation uses a simple bash script wrapper instead.
Solution:
Ensure you're using the latest version of nixos/packages/cursor/extracted.nix from this repository.
Warning messages:
Warning: 'ozone-platform-hint' is not in the list of known options
Warning: 'enable-features' is not in the list of known options
Status: These warnings are harmless and can be ignored. They appear because we pass Wayland-specific flags to enable proper Wayland support. Cursor functions correctly despite these warnings.
Checklist:
ls -la /nix/store/*-cursor-*/file $(which cursor)cursor --verbosesudo nixos-rebuild switch --flake .#desktop --show-tracenix log /nix/store/...-cursor-*.drvIf Cursor attempts to update cursor-agent but fails:
rm -rf ~/.local/share/cursor-agent
nixos/packages/cursor/
├── extracted.nix # Main package definition (AppImage extraction approach)
└── default.nix # Alternative package (AppImage wrapper approach - not used)
We use the extracted.nix approach because:
autoPatchelfHook: Automatically patches ELF binariesasar: Unpacks/repacks VSCode's asar archiveswrapGAppsHook: Sets up GTK/GLib environment variablespatchelf: Runtime patching of cursor-agent binariesripgrep: Replaced with Nix version for consistencyappimageTools.extractautoPatchelfHook and wrapGAppsHook process the binaries