pkgs: add delta (Zed Industries' AI-native editor)
Delta ships a self-contained tarball with no stable download URL (the release API returns a short-lived signed R2 link), so src is a fixed-output derivation that resolves the API at build time. Patch the interpreter/RPATH, add the dlopen'd graphics libs (libglvnd, vulkan-loader, wayland) via a wrapper, and set XKB_CONFIG_ROOT for the bundled libxkbcommon. Registered in the core/lib overlays, exposed as a flake package, and installed on fwbook.
This commit is contained in:
1 parent
b5bde292d2
commit
193d65d367
7 files changed
+147
-6
No files matched your search
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
# Bump delta to a new version.
|
||||
# Usage: ./update.sh [<version>]
|
||||
# With version: bump to that version.
|
||||
# Without args: auto-detect latest nightly from the delta.dev release API.
|
||||
set -euo pipefail
|
||||
|
||||
PKG="delta"
|
||||
API="https://delta.dev/api/releases/nightly"
|
||||
ASSET="asset=delta&os=linux&arch=x86_64"
|
||||
|
||||
if [ $# -ge 1 ]; then
|
||||
VERSION="$1"
|
||||
else
|
||||
echo "Auto-detecting latest ${PKG} version..."
|
||||
VERSION=$(curl -fsSL "${API}/latest/asset?${ASSET}" | jq -r .version)
|
||||
if [ -z "$VERSION" ] || [ "$VERSION" = "null" ]; then
|
||||
echo "Could not auto-detect latest version from delta.dev."
|
||||
echo "Usage: $0 [<version>]"
|
||||
exit 1
|
||||
fi
|
||||
echo "Latest: $VERSION"
|
||||
fi
|
||||
|
||||
# The API hands back a short-lived signed URL; resolve it, then hash the file.
|
||||
URL=$(curl -fsSL "${API}/${VERSION}/asset?${ASSET}" | jq -r .url)
|
||||
|
||||
sed -i "s/version = \".*\";/version = \"${VERSION}\";/" default.nix
|
||||
|
||||
HASH=$(nix hash file --type sha256 --sri <(curl -fsSL "$URL"))
|
||||
sed -i "s|outputHash = \".*\";|outputHash = \"${HASH}\";|" default.nix
|
||||
|
||||
echo "✅ ${PKG} bumped to ${VERSION}"
|
||||
Reference in new issue
Block a user