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
@@ -246,6 +246,7 @@
|
|||||||
ds4 = my-nixpkgs.legacyPackages.${system}.ds4;
|
ds4 = my-nixpkgs.legacyPackages.${system}.ds4;
|
||||||
buzz-desktop = lib.pkgs.${system}.buzz-desktop;
|
buzz-desktop = lib.pkgs.${system}.buzz-desktop;
|
||||||
superset-desktop = lib.pkgs.${system}.superset-desktop;
|
superset-desktop = lib.pkgs.${system}.superset-desktop;
|
||||||
|
delta = lib.pkgs.${system}.delta;
|
||||||
colibri = lib.pkgs.${system}.colibri;
|
colibri = lib.pkgs.${system}.colibri;
|
||||||
herdr = herdr.packages.${system}.default;
|
herdr = herdr.packages.${system}.default;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,6 +115,7 @@
|
|||||||
unstablePkgs.claude-code
|
unstablePkgs.claude-code
|
||||||
buzz-desktop
|
buzz-desktop
|
||||||
bubblewrap
|
bubblewrap
|
||||||
|
delta
|
||||||
herdr
|
herdr
|
||||||
superset-desktop
|
superset-desktop
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
buzz-desktop = final.callPackage ../../pkgs/buzz-desktop { };
|
buzz-desktop = final.callPackage ../../pkgs/buzz-desktop { };
|
||||||
# Superset Desktop AppImage wrapper, see pkgs/superset-desktop.
|
# Superset Desktop AppImage wrapper, see pkgs/superset-desktop.
|
||||||
superset-desktop = final.callPackage ../../pkgs/superset-desktop { };
|
superset-desktop = final.callPackage ../../pkgs/superset-desktop { };
|
||||||
|
# Delta (Zed Industries) prebuilt tarball, see pkgs/delta.
|
||||||
|
delta = final.callPackage ../../pkgs/delta { };
|
||||||
|
|
||||||
# herdr (herdrdev/herdr) — see flake.nix input.
|
# herdr (herdrdev/herdr) — see flake.nix input.
|
||||||
herdr = herdr.packages.${final.stdenv.hostPlatform.system}.default;
|
herdr = herdr.packages.${final.stdenv.hostPlatform.system}.default;
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ let
|
|||||||
niri-touchscreen-gestures = final.callPackage ../pkgs/niri-touchscreen-gestures { };
|
niri-touchscreen-gestures = final.callPackage ../pkgs/niri-touchscreen-gestures { };
|
||||||
buzz-desktop = final.callPackage ../pkgs/buzz-desktop { };
|
buzz-desktop = final.callPackage ../pkgs/buzz-desktop { };
|
||||||
superset-desktop = final.callPackage ../pkgs/superset-desktop { };
|
superset-desktop = final.callPackage ../pkgs/superset-desktop { };
|
||||||
|
delta = final.callPackage ../pkgs/delta { };
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-6
@@ -5,12 +5,13 @@ Packages here are exposed via an overlay defined in `modules/core/default.nix`.
|
|||||||
|
|
||||||
## Contents
|
## Contents
|
||||||
|
|
||||||
| Package | Description |
|
| Package | Description |
|
||||||
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `colibri/` | colibrì (`JustVugg/colibri`) — GLM-5.2/OLMoE local inference engine, built from source, pinned to a tagged release. Backend-parameterized (`backend = "cpu" \| "rocm"`). Exposed as `pkgs.colibri` (cpu, default), `pkgs.colibri-rocm` (Strix Halo / gfx1151). Installs the `coli` CLI (wrapped with the Python env its converter/bench subcommands need) plus the bundled `colibri`/`olmoe` engine binaries. Model weights are a runtime concern and not packaged. |
|
| `colibri/` | colibrì (`JustVugg/colibri`) — GLM-5.2/OLMoE local inference engine, built from source, pinned to a tagged release. Backend-parameterized (`backend = "cpu" \| "rocm"`). Exposed as `pkgs.colibri` (cpu, default), `pkgs.colibri-rocm` (Strix Halo / gfx1151). Installs the `coli` CLI (wrapped with the Python env its converter/bench subcommands need) plus the bundled `colibri`/`olmoe` engine binaries. Model weights are a runtime concern and not packaged. |
|
||||||
| `niri-touchscreen-gestures/` | Python daemon that reads multi-touch events from a touchscreen via `evdev`, detects 2/3/4-finger swipes (up/down/left/right), and dispatches configurable `niri msg action` commands. Configured via TOML; exposed as `pkgs.niri-touchscreen-gestures`. |
|
| `niri-touchscreen-gestures/` | Python daemon that reads multi-touch events from a touchscreen via `evdev`, detects 2/3/4-finger swipes (up/down/left/right), and dispatches configurable `niri msg action` commands. Configured via TOML; exposed as `pkgs.niri-touchscreen-gestures`. |
|
||||||
| `buzz-desktop/` | Block Buzz desktop (Type-2 AppImage from `block/buzz`). Wrapped with `appimageTools.wrapType2` plus extra FHS libs (`elfutils`, `zstd`, WebKit/tray, GStreamer good/bad) so it runs on NixOS. Exposed as `pkgs.buzz-desktop` (`buzz-desktop` binary + desktop entry / icons). |
|
| `buzz-desktop/` | Block Buzz desktop (Type-2 AppImage from `block/buzz`). Wrapped with `appimageTools.wrapType2` plus extra FHS libs (`elfutils`, `zstd`, WebKit/tray, GStreamer good/bad) so it runs on NixOS. Exposed as `pkgs.buzz-desktop` (`buzz-desktop` binary + desktop entry / icons). |
|
||||||
| `superset-desktop/` | Superset Desktop (Type-2 AppImage from `superset-sh/superset`). Wrapped with `appimageTools.wrapType2` plus extra FHS libs (`elfutils`, `zstd`, WebKit/tray, GStreamer good/bad) so it runs on NixOS. Exposed as `pkgs.superset-desktop` (`superset-desktop` binary + desktop entry / icons). |
|
| `superset-desktop/` | Superset Desktop (Type-2 AppImage from `superset-sh/superset`). Wrapped with `appimageTools.wrapType2` plus extra FHS libs (`elfutils`, `zstd`, WebKit/tray, GStreamer good/bad) so it runs on NixOS. Exposed as `pkgs.superset-desktop` (`superset-desktop` binary + desktop entry / icons). |
|
||||||
|
| `delta/` | Delta (Zed Industries' AI-native editor, `delta.dev`) prebuilt tarball. No stable URL exists — the release API returns a short-lived signed R2 link — so `src` is a fixed-output derivation that resolves the API at build time. Interpreter/RPATH patched (`--force-rpath`), dlopen'd graphics libs (`libglvnd`, `vulkan-loader`, `wayland`) added via wrapper, `XKB_CONFIG_ROOT` set for the bundled libxkbcommon. Exposed as `pkgs.delta` (`delta` binary + desktop entry / icons). |
|
||||||
|
|
||||||
## Adding a New Package
|
## Adding a New Package
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,102 @@
|
|||||||
|
{ lib
|
||||||
|
, stdenvNoCC
|
||||||
|
, curl
|
||||||
|
, jq
|
||||||
|
, cacert
|
||||||
|
, patchelf
|
||||||
|
, makeWrapper
|
||||||
|
, glibc
|
||||||
|
, libglvnd
|
||||||
|
, vulkan-loader
|
||||||
|
, wayland
|
||||||
|
, xkeyboard_config
|
||||||
|
}:
|
||||||
|
|
||||||
|
# Delta — AI-native code editor from the creators of Zed (delta.dev).
|
||||||
|
#
|
||||||
|
# Upstream ships a self-contained tarball (Delta/bin/delta + Delta/lib/*.so).
|
||||||
|
# There is no stable download URL: the release API returns JSON whose `url`
|
||||||
|
# field is a short-lived signed R2 link, and the bucket is private. So `src`
|
||||||
|
# is a fixed-output derivation that resolves the API at build time.
|
||||||
|
#
|
||||||
|
# On NixOS we need:
|
||||||
|
# 1. Interpreter + RPATH fixed (binary expects /lib64/ld-linux-x86-64.so.2).
|
||||||
|
# --force-rpath keeps DT_RPATH so the bundled libs' own deps resolve.
|
||||||
|
# 2. dlopen'd libs (libEGL/libvulkan/libwayland-*) on LD_LIBRARY_PATH.
|
||||||
|
# 3. XKB_CONFIG_ROOT — the bundled libxkbcommon defaults to /usr/share/X11/xkb.
|
||||||
|
#
|
||||||
|
# To bump: set `version`, then run ./update.sh <version>.
|
||||||
|
|
||||||
|
let
|
||||||
|
pname = "delta";
|
||||||
|
version = "0.17.0";
|
||||||
|
|
||||||
|
apiUrl = "https://delta.dev/api/releases/nightly/${version}/asset?asset=delta&os=linux&arch=x86_64";
|
||||||
|
|
||||||
|
src = stdenvNoCC.mkDerivation {
|
||||||
|
pname = "${pname}-src";
|
||||||
|
inherit version;
|
||||||
|
|
||||||
|
outputHashMode = "flat";
|
||||||
|
outputHash = "sha256-+AUZre1HCN2hzmF95jY0Xs0n4Fd/yPnfCTG+QGBt6MU=";
|
||||||
|
|
||||||
|
nativeBuildInputs = [ curl jq cacert ];
|
||||||
|
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
|
||||||
|
CURL_CA_BUNDLE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
|
||||||
|
|
||||||
|
buildCommand = ''
|
||||||
|
curl -fsSL '${apiUrl}' | jq -r .url > url
|
||||||
|
curl -fsSL "$(cat url)" -o "$out"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
|
stdenvNoCC.mkDerivation {
|
||||||
|
inherit pname version src;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ patchelf makeWrapper ];
|
||||||
|
|
||||||
|
# Keep the RPATH we set below (don't let fixup shrink it).
|
||||||
|
dontShrinkRPath = true;
|
||||||
|
|
||||||
|
unpackPhase = ''
|
||||||
|
runHook preUnpack
|
||||||
|
tar xzf "$src"
|
||||||
|
runHook postUnpack
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out/lib/delta
|
||||||
|
cp -a Delta/. $out/lib/delta/
|
||||||
|
chmod -R u+w $out/lib/delta
|
||||||
|
rm -f $out/lib/delta/install.sh
|
||||||
|
|
||||||
|
# Fix interpreter + RPATH. --force-rpath keeps DT_RPATH (inherited by the
|
||||||
|
# bundled libs) instead of DT_RUNPATH (not inherited).
|
||||||
|
patchelf \
|
||||||
|
--force-rpath \
|
||||||
|
--set-rpath '$ORIGIN/../lib:${glibc}/lib' \
|
||||||
|
$out/lib/delta/bin/delta
|
||||||
|
|
||||||
|
mkdir -p $out/bin
|
||||||
|
makeWrapper $out/lib/delta/bin/delta $out/bin/delta \
|
||||||
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libglvnd vulkan-loader wayland ]}" \
|
||||||
|
--set XKB_CONFIG_ROOT ${xkeyboard_config}/share/X11/xkb
|
||||||
|
|
||||||
|
install -Dm444 $out/lib/delta/share/applications/dev.zed.Delta.desktop \
|
||||||
|
$out/share/applications/dev.zed.Delta.desktop
|
||||||
|
cp -a $out/lib/delta/share/icons/. $out/share/icons/
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Delta — AI-native code editor from the creators of Zed";
|
||||||
|
homepage = "https://delta.dev";
|
||||||
|
license = lib.licenses.unfree;
|
||||||
|
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
|
||||||
|
platforms = [ "x86_64-linux" ];
|
||||||
|
mainProgram = "delta";
|
||||||
|
};
|
||||||
|
}
|
||||||
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