push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,104 @@
{
lib,
stdenv,
callPackage,
vscode-generic,
fetchurl,
appimageTools,
undmg,
commandLineArgs ? "",
useVSCodeRipgrep ? stdenv.hostPlatform.isDarwin,
}:
let
inherit (stdenv) hostPlatform;
finalCommandLineArgs = "--update=false " + commandLineArgs;
sources = {
x86_64-linux = fetchurl {
url = "https://downloads.cursor.com/production/3ccce8f55d8cca49f6d28b491a844c699b8719a3/linux/x64/Cursor-1.6.45-x86_64.AppImage";
hash = "sha256-MlrevU26gD6hpZbqbdKQwnzJbm5y9SVSb3d0BGnHtpc=";
};
aarch64-linux = fetchurl {
url = "https://downloads.cursor.com/production/3ccce8f55d8cca49f6d28b491a844c699b8719a3/linux/arm64/Cursor-1.6.45-aarch64.AppImage";
hash = "sha256-eFHYRwVXhWB3zCnJFYodIxjR2ewP8ETgwyjBdB86oTk=";
};
x86_64-darwin = fetchurl {
url = "https://downloads.cursor.com/production/3ccce8f55d8cca49f6d28b491a844c699b8719a3/darwin/x64/Cursor-darwin-x64.dmg";
hash = "sha256-UGmMX9Wr69i2EqQSLkj9/ROs8HpLtc/x0IYDJdzvD6U=";
};
aarch64-darwin = fetchurl {
url = "https://downloads.cursor.com/production/3ccce8f55d8cca49f6d28b491a844c699b8719a3/darwin/arm64/Cursor-darwin-arm64.dmg";
hash = "sha256-lcuJiAgHXPEUZHNeanBq10znXKFKJ6yrluuZjdaQbyA=";
};
};
source = sources.${hostPlatform.system};
in
(callPackage vscode-generic rec {
inherit useVSCodeRipgrep;
commandLineArgs = finalCommandLineArgs;
version = "1.6.45";
pname = "cursor";
# You can find the current VSCode version in the About dialog:
# workbench.action.showAboutDialog (Help: About)
vscodeVersion = "1.99.3";
executableName = "cursor";
longName = "Cursor";
shortName = "cursor";
libraryName = "cursor";
iconName = "cursor";
src =
if hostPlatform.isLinux then
appimageTools.extract {
inherit pname version;
src = source;
}
else
source;
sourceRoot =
if hostPlatform.isLinux then "${pname}-${version}-extracted/usr/share/cursor" else "Cursor.app";
tests = { };
updateScript = ./update.sh;
# Editing the `cursor` binary within the app bundle causes the bundle's signature
# to be invalidated, which prevents launching starting with macOS Ventura, because Cursor is notarized.
# See https://eclecticlight.co/2022/06/17/app-security-changes-coming-in-ventura/ for more information.
dontFixup = stdenv.hostPlatform.isDarwin;
# Cursor has no wrapper script.
patchVSCodePath = false;
meta = {
description = "AI-powered code editor built on vscode";
homepage = "https://cursor.com";
changelog = "https://cursor.com/changelog";
license = lib.licenses.unfree;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
maintainers = with lib.maintainers; [
aspauldingcode
prince213
];
platforms = [
"aarch64-linux"
"x86_64-linux"
]
++ lib.platforms.darwin;
mainProgram = "cursor";
};
}).overrideAttrs
(oldAttrs: {
nativeBuildInputs =
(oldAttrs.nativeBuildInputs or [ ]) ++ lib.optionals hostPlatform.isDarwin [ undmg ];
passthru = (oldAttrs.passthru or { }) // {
inherit sources;
};
})

View File

@@ -0,0 +1,39 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq coreutils common-updater-scripts
set -eu -o pipefail
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; code-cursor.version or (lib.getVersion code-cursor)" | tr -d '"')
declare -A platforms=( [x86_64-linux]='linux-x64' [aarch64-linux]='linux-arm64' [x86_64-darwin]='darwin-x64' [aarch64-darwin]='darwin-arm64' )
declare -A updates=( )
first_version=""
for platform in ${!platforms[@]}; do
api_platform=${platforms[$platform]}
result=$(curl -s "https://api2.cursor.sh/updates/api/download/stable/$api_platform/cursor")
version=$(echo $result | jq -r '.version')
if [[ "$version" == "$currentVersion" ]]; then
exit 0
fi
if [[ -z "$first_version" ]]; then
first_version=$version
first_platform=$platform
elif [[ "$version" != "$first_version" ]]; then
>&2 echo "Multiple versions found: $first_version ($first_platform) and $version ($platform)"
exit 1
fi
url=$(echo $result | jq -r '.downloadUrl')
# Exits with code 22 if not downloadable
curl --output /dev/null --silent --head --fail "$url"
updates+=( [$platform]="$result" )
done
# Install updates
for platform in ${!updates[@]}; do
result=${updates[$platform]}
version=$(echo $result | jq -r '.version')
url=$(echo $result | jq -r '.downloadUrl')
source=$(nix-prefetch-url "$url" --name "cursor-$version")
hash=$(nix-hash --to-sri --type sha256 "$source")
update-source-version code-cursor $version $hash "$url" --system=$platform --ignore-same-version --source-key="sources.$platform"
done