-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.nix
More file actions
51 lines (40 loc) · 1.4 KB
/
Copy pathdefault.nix
File metadata and controls
51 lines (40 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ pkgs ? import <nixpkgs> {} }:
let
# Detect system architecture
system = pkgs.stdenv.hostPlatform.system;
# Map Nix system to cursor-agent naming
osArch = {
"x86_64-linux" = { os = "linux"; arch = "x64"; };
"aarch64-linux" = { os = "linux"; arch = "arm64"; };
"x86_64-darwin" = { os = "darwin"; arch = "x64"; };
"aarch64-darwin" = { os = "darwin"; arch = "arm64"; };
}.${system} or (throw "Unsupported system: ${system}");
version = "2025.10.02-bd871ac";
# Download and extract the cursor-agent package
cursor-agent-package = pkgs.stdenv.mkDerivation {
pname = "cursor-agent-package";
inherit version;
src = pkgs.fetchurl {
url = "https://downloads.cursor.com/lab/${version}/${osArch.os}/${osArch.arch}/agent-cli-package.tar.gz";
sha256 = "sha256-tqppTOkeChlyw3IjSkhGpNvMX9U5s2hiu13/RWakENg=";
};
sourceRoot = ".";
installPhase = ''
mkdir -p $out
cp -r * $out/
'';
};
in pkgs.buildFHSUserEnv {
name = "cursor-agent";
targetPkgs = pkgs: [
pkgs.stdenv.cc.cc.lib
];
runScript = pkgs.writeShellScript "cursor-agent-wrapper" ''
exec ${cursor-agent-package}/dist-package/node ${cursor-agent-package}/dist-package/index.js "$@"
'';
meta = with pkgs.lib; {
description = "Cursor Agent CLI - AI-powered coding assistant";
homepage = "https://cursor.com";
platforms = [ "x86_64-linux" "aarch64-linux" ];
};
}