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,67 @@
{
lib,
fetchurl,
stdenv,
autoPatchelfHook,
}:
let
inherit (stdenv) hostPlatform;
sources = {
x86_64-linux = fetchurl {
url = "https://downloads.cursor.com/lab/2025.10.02-bd871ac/linux/x64/agent-cli-package.tar.gz";
hash = "sha256-tqppTOkeChlyw3IjSkhGpNvMX9U5s2hiu13/RWakENg=";
};
aarch64-linux = fetchurl {
url = "https://downloads.cursor.com/lab/2025.10.02-bd871ac/linux/arm64/agent-cli-package.tar.gz";
hash = "sha256-Gf/2wLS2+xQ6Mu4u96n4hI1I4L2iIG16R668BQCNZaw=";
};
x86_64-darwin = fetchurl {
url = "https://downloads.cursor.com/lab/2025.10.02-bd871ac/darwin/x64/agent-cli-package.tar.gz";
hash = "sha256-/qznJxLpyUBH4L6zJSDB5mVFVk2Y7UJCt2Uw5g7U6AQ=";
};
aarch64-darwin = fetchurl {
url = "https://downloads.cursor.com/lab/2025.10.02-bd871ac/darwin/arm64/agent-cli-package.tar.gz";
hash = "sha256-drbaPM4ho5/1vmQWMgBelmqR7Np45w/XR0ZsfR53vZI=";
};
};
in
stdenv.mkDerivation {
pname = "cursor-cli";
version = "0-unstable-2025-10-02";
src = sources.${hostPlatform.system};
nativeBuildInputs = lib.optionals hostPlatform.isLinux [
autoPatchelfHook
stdenv.cc.cc.lib
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share/cursor-agent
cp -r * $out/share/cursor-agent/
ln -s $out/share/cursor-agent/cursor-agent $out/bin/cursor-agent
runHook postInstall
'';
passthru = {
inherit sources;
updateScript = ./update.sh;
};
meta = {
description = "Cursor CLI";
homepage = "https://cursor.com/cli";
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [
sudosubin
andrewbastin
];
platforms = builtins.attrNames sources;
mainProgram = "cursor-agent";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
}

View File

@@ -0,0 +1,32 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl coreutils common-updater-scripts
set -eu -o pipefail
release=$(curl -s https://cursor.com/install | grep -oP "lab/\K[^/]+")
# Check if release matches the pattern YYYY.MM.DD-{commithash}
if [[ "$release" =~ ^[0-9]{4}\.[0-9]{2}\.[0-9]{2}-[a-f0-9]+$ ]]; then
timestamp=$(echo "$release" | cut -d"-" -f1 | tr "." "-")
latestVersion="0-unstable-$timestamp"
else
latestVersion="$release"
fi
currentVersion=$(nix eval --raw -f . cursor-cli.version)
echo "latest version: $latestVersion"
echo "current version: $currentVersion"
if [[ "$latestVersion" == "$currentVersion" ]]; then
echo "package is up-to-date"
exit 0
fi
declare -A platforms=( [x86_64-linux]="linux/x64" [aarch64-linux]="linux/arm64" [x86_64-darwin]="darwin/x64" [aarch64-darwin]="darwin/arm64" )
for platform in "${!platforms[@]}"; do
url="https://downloads.cursor.com/lab/$release/${platforms[$platform]}/agent-cli-package.tar.gz"
source=$(nix-prefetch-url "$url" --name "cursor-cli-$latestVersion")
hash=$(nix-hash --to-sri --type sha256 "$source")
update-source-version cursor-cli "$latestVersion" "$hash" "$url" --system="$platform" --source-key="sources.$platform" --ignore-same-version
done