clean up of ds4 (using my fork of it instead) + update scripts!!!
This commit is contained in:
1 parent
fd5bb0af6e
commit
507d603ef0
20 files changed
+209
-837
No files matched your search
+19
-7
@@ -5,13 +5,12 @@ Packages here are exposed via an overlay defined in `modules/core/default.nix`.
|
||||
|
||||
## Contents
|
||||
|
||||
| Package | Description |
|
||||
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `ds4/` | DwarfStar (`antirez/ds4`) DeepSeek V4 local inference engine, built from source. Backend-parameterized (`backend = "cpu" \| "rocm" \| "cuda"`); tracks `main` and builds per-host. Exposed as `pkgs.ds4` (cpu, default), `pkgs.ds4-rocm` (Strix Halo / gfx1151), `pkgs.ds4-cuda`. Installs the `ds4`, `ds4-server`, `ds4-bench`, `ds4-eval`, `ds4-agent` binaries plus a `ds4-download-model` helper for fetching GGUF weights. 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`. |
|
||||
| `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). |
|
||||
| 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. |
|
||||
| `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). |
|
||||
| `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). |
|
||||
|
||||
## Adding a New Package
|
||||
|
||||
@@ -25,6 +24,19 @@ Packages here are exposed via an overlay defined in `modules/core/default.nix`.
|
||||
3. Reference it as `pkgs.<name>` anywhere in the flake
|
||||
4. Optionally expose it as a flake output in `flake.nix` under `packages`
|
||||
|
||||
## Updating Packages
|
||||
|
||||
Each package can have an `update.sh` script that automates version bumps.
|
||||
|
||||
- **`skyg pkgs bump <pkg-name> <version>`** — bump a specific package to a specific version.
|
||||
- **`skyg pkgs update --all`** — auto-detect the latest version for all packages that have `update.sh`.
|
||||
- **`skyg pkgs update <pkg-name>`** — auto-detect the latest version for a single package.
|
||||
|
||||
Each `update.sh` supports two modes:
|
||||
|
||||
- `./update.sh <version>` — bump to the given version.
|
||||
- `./update.sh` (no args) — auto-detect the latest version from upstream.
|
||||
|
||||
## Notes
|
||||
|
||||
- For unfree or binary packages, set `meta.license` and `meta.sourceProvenance` accurately
|
||||
|
||||
@@ -23,11 +23,11 @@
|
||||
|
||||
let
|
||||
pname = "buzz-desktop";
|
||||
version = "0.5.24";
|
||||
version = "0.5.25";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/block/buzz/releases/download/desktop-v${version}/Buzz_${version}_amd64.AppImage";
|
||||
hash = "sha256-cD5s/yEvfqu8ZbPLgWxW1lqoWMQ1o94xVP+7MjrJNws=";
|
||||
hash = "sha256-cTYnPVPjqQzwY/PpyDXlU0a+NQLY7StpayPHg5fU8Ek=";
|
||||
};
|
||||
|
||||
extracted = appimageTools.extractType2 {
|
||||
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
# Bump buzz-desktop to a new version.
|
||||
# Usage: ./update.sh [<version>]
|
||||
# With version: bump to that version.
|
||||
# Without args: auto-detect latest from GitHub releases.
|
||||
set -euo pipefail
|
||||
|
||||
PKG="buzz-desktop"
|
||||
REPO="block/buzz"
|
||||
URL_TEMPLATE="https://github.com/block/buzz/releases/download/desktop-v\${VERSION}/Buzz_\${VERSION}_amd64.AppImage"
|
||||
|
||||
if [ $# -ge 1 ]; then
|
||||
VERSION="$1"
|
||||
else
|
||||
echo "Auto-detecting latest buzz-desktop version..."
|
||||
VERSION=$(curl -fsSL "https://api.github.com/repos/${REPO}/releases" \
|
||||
| jq -r '[.[] | select(.tag_name | startswith("desktop-v")) | .tag_name | sub("^desktop-v"; "")] | .[0]')
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "Could not auto-detect latest version from GitHub."
|
||||
echo "Usage: $0 [<version>]"
|
||||
exit 1
|
||||
fi
|
||||
echo "Latest: $VERSION"
|
||||
fi
|
||||
|
||||
URL=$(eval "echo $URL_TEMPLATE")
|
||||
|
||||
sed -i "s/version = \".*\";/version = \"${VERSION}\";/" default.nix
|
||||
|
||||
HASH=$(nix hash file --type sha256 --sri <(curl -fsSL "$URL"))
|
||||
sed -i "s|hash = \".*\";|hash = \"${HASH}\";|" default.nix
|
||||
|
||||
echo "✅ ${PKG} bumped to ${VERSION}"
|
||||
@@ -1,128 +0,0 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, dpkg
|
||||
, autoPatchelfHook
|
||||
, makeWrapper
|
||||
, alsa-lib
|
||||
, at-spi2-atk
|
||||
, cairo
|
||||
, cups
|
||||
, dbus
|
||||
, expat
|
||||
, gdk-pixbuf
|
||||
, glib
|
||||
, gtk3
|
||||
, libcap_ng
|
||||
, libdrm
|
||||
, libseccomp
|
||||
, libxkbcommon
|
||||
, libx11
|
||||
, libxcomposite
|
||||
, libxdamage
|
||||
, libxext
|
||||
, libxfixes
|
||||
, libxrandr
|
||||
, libxcb
|
||||
, mesa
|
||||
, nspr
|
||||
, nss
|
||||
, pango
|
||||
, systemd
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "claude-desktop";
|
||||
version = "1.22209.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://downloads.claude.ai/claude-desktop/apt/stable/pool/main/c/claude-desktop/claude-desktop_${finalAttrs.version}_amd64.deb";
|
||||
hash = "sha256:6d18ae792c2bddad01edc97c2c3f4cf489004cefe8fed6760a696ed25c49bf61";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ dpkg autoPatchelfHook makeWrapper ];
|
||||
|
||||
buildInputs = [
|
||||
alsa-lib
|
||||
at-spi2-atk
|
||||
cairo
|
||||
cups
|
||||
dbus
|
||||
expat
|
||||
gdk-pixbuf
|
||||
glib
|
||||
gtk3
|
||||
libcap_ng
|
||||
libdrm
|
||||
libseccomp
|
||||
libxkbcommon
|
||||
libx11
|
||||
libxcomposite
|
||||
libxdamage
|
||||
libxext
|
||||
libxfixes
|
||||
libxrandr
|
||||
libxcb
|
||||
mesa
|
||||
nspr
|
||||
nss
|
||||
pango
|
||||
systemd
|
||||
];
|
||||
|
||||
unpackPhase = ''
|
||||
mkdir -p work
|
||||
cd work
|
||||
ar x $src
|
||||
tar -xf data.tar.xz --no-same-permissions || tar -xf data.tar.xz
|
||||
cd ..
|
||||
mv work/usr .
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out
|
||||
cp -r usr/* $out/
|
||||
|
||||
# Move the original binary and create a wrapper
|
||||
mv $out/lib/claude-desktop/claude-desktop $out/lib/claude-desktop/.claude-desktop-wrapped
|
||||
makeWrapper $out/lib/claude-desktop/.claude-desktop-wrapped $out/bin/claude-desktop \
|
||||
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [
|
||||
mesa
|
||||
libxkbcommon
|
||||
libx11
|
||||
libxcomposite
|
||||
libxdamage
|
||||
libxext
|
||||
libxfixes
|
||||
libxrandr
|
||||
libxcb
|
||||
glib
|
||||
nspr
|
||||
nss
|
||||
cairo
|
||||
pango
|
||||
gdk-pixbuf
|
||||
at-spi2-atk
|
||||
dbus
|
||||
cups
|
||||
systemd
|
||||
alsa-lib
|
||||
]}"
|
||||
|
||||
# Fix desktop-file Exec/Icon paths if present
|
||||
if [ -d usr/share/applications ]; then
|
||||
substituteInPlace $out/share/applications/*.desktop \
|
||||
--replace-quiet "/usr/bin/claude-desktop" "$out/bin/claude-desktop" || true
|
||||
fi
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Claude Desktop for Linux";
|
||||
homepage = "https://claude.ai/download";
|
||||
license = lib.licenses.unfree;
|
||||
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
||||
mainProgram = "claude-desktop";
|
||||
};
|
||||
})
|
||||
@@ -42,7 +42,7 @@ let
|
||||
# nix cc-wrapper, so it needs explicit -I include paths to find the HIP
|
||||
# runtime + rocWMMA headers. rocWMMA defines COLI_GPU_HAS_WMMA in
|
||||
# backend_gpu_compat.h; without its include dir that macro is undeclared and
|
||||
# backend_cuda.cu fails to compile (mirrors the ds4 rocm build inputs).
|
||||
# backend_cuda.cu fails to compile.
|
||||
rocmInputs = lib.optionals (backend == "rocm") [
|
||||
rocmPackages.clr # provides hipcc + HIP runtime
|
||||
rocmPackages.rocm-runtime
|
||||
@@ -77,13 +77,13 @@ let
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
pname = "colibri" + lib.optionalString (backend == "rocm") "-rocm";
|
||||
version = "1.5.0";
|
||||
version = "1.12.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "JustVugg";
|
||||
repo = "colibri";
|
||||
rev = "8f512fc8c2f48ffa18cd624cd4a5bcaae4a4abfc"; # tag v1.5.0
|
||||
hash = "sha256-SW5RDghfITxblAI+nZGVCHULrTQxskzdNHguJkSMfN4=";
|
||||
rev = "1c59bff28738f808b130d14758d5a76fc7047e0d"; # tag v1.5.0
|
||||
hash = "sha256-A2+k57KNvTBKWe8Ts1XrQaJn5X7C5G5TLFo+5Uu5Mkk=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
# Bump colibri to a new version.
|
||||
# Usage: ./update.sh [<version>]
|
||||
# With version: bump to that version (e.g. "1.6.0").
|
||||
# Without args: auto-detect latest tag from GitHub.
|
||||
set -euo pipefail
|
||||
|
||||
PKG="colibri"
|
||||
REPO="JustVugg/colibri"
|
||||
|
||||
if [ $# -ge 1 ]; then
|
||||
VERSION="$1"
|
||||
else
|
||||
echo "Auto-detecting latest colibri version..."
|
||||
VERSION=$(curl -fsSL "https://api.github.com/repos/${REPO}/releases" \
|
||||
| jq -r '[.[] | select(.tag_name | startswith("v")) | .tag_name | sub("^v"; "")] | .[0]')
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "Could not auto-detect latest version from GitHub."
|
||||
echo "Usage: $0 [<version>]"
|
||||
exit 1
|
||||
fi
|
||||
echo "Latest: $VERSION"
|
||||
fi
|
||||
|
||||
# Resolve tag to commit hash
|
||||
REV=$(git ls-remote "https://github.com/${REPO}" "v${VERSION}" | awk '{print $1}')
|
||||
if [ -z "$REV" ]; then
|
||||
echo "Could not find tag v${VERSION} in upstream repo"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sed -i "s/version = \".*\";/version = \"${VERSION}\";/" default.nix
|
||||
sed -i "s|rev = \".*\";|rev = \"${REV}\";|" default.nix
|
||||
|
||||
HASH=$(nix hash file --type sha256 --sri <(curl -fsSL "https://github.com/${REPO}/archive/${REV}.tar.gz"))
|
||||
sed -i "s|hash = \".*\";|hash = \"${HASH}\";|" default.nix
|
||||
|
||||
echo "✅ ${PKG} bumped to ${VERSION} (rev ${REV})"
|
||||
@@ -1,199 +0,0 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, makeWrapper
|
||||
, curl
|
||||
, cacert
|
||||
, python3
|
||||
, rocmPackages
|
||||
, cudaPackages
|
||||
# backend selects the build target / toolchain.
|
||||
, backend ? "cpu" # one of "cpu" | "rocm" | "cuda"
|
||||
# CUDA: null => `cuda-generic` (CUDA_ARCH=native, build host == GPU host);
|
||||
# set e.g. "sm_89" to pin an arch via `make cuda CUDA_ARCH=sm_89`.
|
||||
, cudaArch ? null
|
||||
# ROCm: GPU target. gfx1151 == AMD Strix Halo (the upstream default).
|
||||
, rocmArch ? "gfx1151"
|
||||
}:
|
||||
|
||||
# DwarfStar (antirez/ds4) — a from-source DeepSeek V4 Flash/PRO local inference
|
||||
# engine. Upstream is a hand-written Makefile with no `install` target and no
|
||||
# tagged releases, so we pin a `main` commit and write our own installPhase.
|
||||
#
|
||||
# This derivation is *backend-parameterized*: pick the GPU backend with the
|
||||
# `backend` argument ("cpu" | "rocm" | "cuda"). The overlay in
|
||||
# modules/core/default.nix wires up `ds4` (cpu), `ds4-rocm`, and `ds4-cuda`.
|
||||
#
|
||||
# Build-per-host: we keep upstream's `-march=native` default (NATIVE_CPU_FLAG),
|
||||
# so the resulting store paths are CPU-specific and are NOT safe to share across
|
||||
# heterogeneous machines. Build each variant on (or for) its target host. The
|
||||
# GPU variants must be built on a machine carrying the matching toolchain.
|
||||
#
|
||||
# To bump: set `rev` to the new `main` HEAD and refresh `hash` (start from
|
||||
# lib.fakeHash and copy the SRI hash from the build error, or use
|
||||
# `nix-prefetch-url --unpack https://github.com/antirez/ds4/archive/<rev>.tar.gz`
|
||||
# then `nix hash to-sri --type sha256 <hash>`).
|
||||
|
||||
assert lib.elem backend [ "cpu" "rocm" "cuda" ];
|
||||
|
||||
let
|
||||
# `hf` CLI used by ds4-download-model for the large/sharded GGUF files
|
||||
# (MXFP4, PRO, GLM). huggingface-hub provides the `hf` binary; hf-xet is the
|
||||
# optional Xet backend it uses to speed up big transfers. Default python3 is
|
||||
# 3.14, so this resolves to python314Packages.{huggingface-hub,hf-xet}.
|
||||
pythonEnv = python3.withPackages (
|
||||
ps: with ps; [
|
||||
huggingface-hub
|
||||
hf-xet
|
||||
]
|
||||
);
|
||||
|
||||
# ROCm libraries the gfx kernels and link flags (-lhipblas -lhipblaslt) need.
|
||||
rocmInputs = [
|
||||
rocmPackages.clr # provides hipcc + HIP runtime
|
||||
rocmPackages.hipblas
|
||||
rocmPackages.hipblas-common # hipblas.h includes hipblas-common/hipblas-common.h
|
||||
rocmPackages.hipblaslt
|
||||
rocmPackages.rocblas
|
||||
rocmPackages.rocwmma # gfx1151 backend uses rocWMMA headers
|
||||
rocmPackages.hipcub
|
||||
rocmPackages.rocprim
|
||||
rocmPackages.rocthrust
|
||||
rocmPackages.rocm-runtime
|
||||
];
|
||||
|
||||
# -L<dir> and matching rpath so the linked binaries resolve the ROCm .so's
|
||||
# from the store at runtime (upstream assumes /opt/rocm on PATH).
|
||||
rocmLibDirs = map (p: "${lib.getLib p}/lib") rocmInputs;
|
||||
rocmLinkFlags =
|
||||
lib.concatStringsSep " "
|
||||
(map (d: "-L${d} -Wl,-rpath,${d}") rocmLibDirs);
|
||||
rocmIncludeFlags =
|
||||
lib.concatStringsSep " "
|
||||
(map (p: "-I${lib.getDev p}/include") rocmInputs);
|
||||
|
||||
# CUDA libs we link against; nvcc is the linker for the cuda build.
|
||||
cudaLibDirs = [
|
||||
"${lib.getLib cudaPackages.cuda_cudart}/lib"
|
||||
"${lib.getLib cudaPackages.libcublas}/lib"
|
||||
];
|
||||
cudaLinkFlags =
|
||||
lib.concatStringsSep " "
|
||||
(map (d: "-L${d} -Xlinker -rpath -Xlinker ${d}") cudaLibDirs);
|
||||
|
||||
# phony Makefile target per backend.
|
||||
buildTarget = {
|
||||
cpu = "cpu";
|
||||
rocm = "strix-halo";
|
||||
cuda = if cudaArch == null then "cuda-generic" else "cuda";
|
||||
}.${backend};
|
||||
|
||||
# Per-backend command-line variable overrides (forwarded to the recursive
|
||||
# sub-make as MAKEOVERRIDES, beating the Makefile's `?=` defaults).
|
||||
#
|
||||
# `makeFlags` entries are expanded UNQUOTED by the generic builder, so any
|
||||
# value containing spaces (CFLAGS/LDLIBS) would be word-split and make would
|
||||
# treat the extra words as bogus options. Those go through `makeFlagsArray`
|
||||
# (a quoted bash array, set in preBuild) instead; only space-free assignments
|
||||
# may live in `makeFlags`.
|
||||
backendMakeFlags = {
|
||||
cpu = [ ];
|
||||
rocm = [ "ROCM_ARCH=${rocmArch}" ];
|
||||
cuda = [
|
||||
"NVCC=${lib.getExe' cudaPackages.cuda_nvcc "nvcc"}"
|
||||
"CUDA_HOME=${cudaPackages.cuda_nvcc}"
|
||||
] ++ lib.optional (cudaArch != null) "CUDA_ARCH=${cudaArch}";
|
||||
}.${backend};
|
||||
|
||||
# Space-containing variable assignments (must survive word splitting).
|
||||
backendMakeFlagsArray = {
|
||||
cpu = [ ];
|
||||
rocm = [
|
||||
# Append store include/lib paths to the upstream ROCm flags (hipcc is the
|
||||
# raw ROCm compiler, not the nix cc-wrapper, so it needs explicit -I/-L).
|
||||
"ROCM_CFLAGS=-O3 -ffast-math -g -fno-finite-math-only -pthread -D__HIP_PLATFORM_AMD__ -Wno-unused-command-line-argument --offload-arch=${rocmArch} ${rocmIncludeFlags}"
|
||||
"ROCM_LDLIBS=-lm -pthread ${rocmLinkFlags} -lhipblas -lhipblaslt -lrocblas"
|
||||
];
|
||||
cuda = [
|
||||
# Replace upstream's hardcoded /usr/local/cuda + sbsa-linux (aarch64)
|
||||
# paths with the nixpkgs cudart/cublas store paths.
|
||||
"CUDA_LDLIBS=-lm -Xcompiler -pthread ${cudaLinkFlags} -lcudart -lcublas"
|
||||
];
|
||||
}.${backend};
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "ds4" + lib.optionalString (backend != "cpu") "-${backend}";
|
||||
version = "0-unstable-2026-09-16";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "antirez";
|
||||
repo = "ds4";
|
||||
rev = "8db1d1d155cb0400a86a86b9c62d0defb3a6148b";
|
||||
hash = "sha256-d0TRJH5/cNlDrgJy2i9eEUuSAlnka0BvxDXlXIwMwrE=";
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
nativeBuildInputs =
|
||||
[ makeWrapper ]
|
||||
++ lib.optionals (backend == "rocm") [ rocmPackages.clr ]
|
||||
++ lib.optionals (backend == "cuda") [ cudaPackages.cuda_nvcc ];
|
||||
|
||||
buildInputs =
|
||||
lib.optionals (backend == "rocm") rocmInputs
|
||||
++ lib.optionals (backend == "cuda") [
|
||||
cudaPackages.cuda_cudart
|
||||
cudaPackages.libcublas
|
||||
];
|
||||
|
||||
makeFlags = backendMakeFlags;
|
||||
buildFlags = [ buildTarget ];
|
||||
|
||||
# Pass space-containing make variables as a quoted array so they aren't
|
||||
# word-split (see backendMakeFlagsArray note above).
|
||||
preBuild = lib.optionalString (backendMakeFlagsArray != [ ]) ''
|
||||
makeFlagsArray+=(${lib.escapeShellArgs backendMakeFlagsArray})
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
install -Dm755 -t "$out/bin" ds4 ds4-server ds4-bench ds4-eval ds4-agent
|
||||
|
||||
# Wire upstream's GGUF downloader in as `ds4-download-model`. Patch its
|
||||
# project-root detection so the gguf dir and the `ds4flash.gguf` symlink
|
||||
# land in a writable location ($DS4_HOME, default: cwd) instead of the
|
||||
# read-only store dir that `dirname $0` would resolve to here.
|
||||
install -Dm755 download_model.sh "$out/bin/ds4-download-model"
|
||||
substituteInPlace "$out/bin/ds4-download-model" \
|
||||
--replace-fail 'ROOT=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)' 'ROOT=''${DS4_HOME:-$PWD}' \
|
||||
--replace-warn './download_model.sh' 'ds4-download-model'
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
# `ds4-download-model` shells out to curl (and optionally the `hf` CLI for the
|
||||
# huge PRO files); make curl available and point it at a CA bundle if the
|
||||
# environment doesn't already set one.
|
||||
postFixup = ''
|
||||
wrapProgram "$out/bin/ds4-download-model" \
|
||||
--prefix PATH : ${lib.makeBinPath [ curl pythonEnv ]} \
|
||||
--set-default SSL_CERT_FILE ${cacert}/etc/ssl/certs/ca-bundle.crt
|
||||
'';
|
||||
|
||||
# Only the CPU variant is guaranteed to run without a GPU/device present, so
|
||||
# restrict the smoke check to it. GPU variants are validated on real hardware.
|
||||
doInstallCheck = backend == "cpu";
|
||||
installCheckPhase = ''
|
||||
runHook preInstallCheck
|
||||
"$out/bin/ds4" --help >/dev/null
|
||||
runHook postInstallCheck
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "DeepSeek V4 Flash/PRO local inference engine (DwarfStar)";
|
||||
homepage = "https://github.com/antirez/ds4";
|
||||
license = lib.licenses.mit;
|
||||
sourceProvenance = [ lib.sourceTypes.fromSource ];
|
||||
platforms = lib.platforms.linux; # Metal backend is macOS-only, out of scope
|
||||
mainProgram = "ds4";
|
||||
};
|
||||
})
|
||||
@@ -1,102 +0,0 @@
|
||||
# ds4 (DwarfStar) — user guide
|
||||
|
||||
A from-source build of [`antirez/ds4`](https://github.com/antirez/ds4), a local
|
||||
inference engine for **DeepSeek V4 Flash/PRO**. This is a short operational
|
||||
guide; see the [upstream README](https://github.com/antirez/ds4) for the full
|
||||
documentation (server API, agent, distributed inference, tuning, etc.).
|
||||
|
||||
## What's installed
|
||||
|
||||
The package builds for a chosen GPU backend (`cpu`, `rocm`, or `cuda`) and
|
||||
installs these binaries:
|
||||
|
||||
| Binary | What it does |
|
||||
|---|---|
|
||||
| `ds4` | Interactive CLI chat / one-shot `-p "..."` |
|
||||
| `ds4-server` | OpenAI/Anthropic/Responses-compatible HTTP API |
|
||||
| `ds4-agent` | Native terminal coding agent (alpha) |
|
||||
| `ds4-bench` | Throughput benchmarking |
|
||||
| `ds4-eval` | Capability/regression eval harness |
|
||||
| `ds4-download-model` | Helper to fetch GGUF weights (see below) |
|
||||
|
||||
There is **no graphical UI**. `ds4-server` exposes a URL you can point an
|
||||
OpenAI-compatible client at.
|
||||
|
||||
## 1. Get the weights
|
||||
|
||||
Weights are **not** packaged. They live at the project's Hugging Face repos
|
||||
([`antirez/deepseek-v4-gguf`](https://huggingface.co/antirez/deepseek-v4-gguf)
|
||||
for DeepSeek V4, [`antirez/GLM-5.2-GGUF`](https://huggingface.co/antirez/GLM-5.2-GGUF)
|
||||
and [`unsloth/GLM-5.2-GGUF`](https://huggingface.co/unsloth/GLM-5.2-GGUF) for
|
||||
GLM 5.2) — public, MIT, no token needed — and only these custom GGUFs work, not
|
||||
arbitrary DeepSeek/GLM GGUFs.
|
||||
|
||||
`ds4-download-model` writes into `./gguf` and links `./ds4flash.gguf` in the
|
||||
current directory (override the root with `DS4_HOME`, or the gguf dir with
|
||||
`DS4_GGUF_DIR`):
|
||||
|
||||
```sh
|
||||
# DeepSeek V4 Flash (0731 checkpoints)
|
||||
ds4-download-model ds4f-q2 # ~81 GB, the pick for 96/128 GB machines
|
||||
ds4-download-model ds4f-q2-q4 # ~98 GB, last 6 expert layers at q4
|
||||
ds4-download-model ds4f-q4 # ~153 GB, for >=256 GB machines
|
||||
ds4-download-model ds4f-mxfp4 # ~156 GB, native MXFP4 (Metal/CUDA)
|
||||
ds4-download-model ds4f-dspark # ~6 GB, optional DSpark speculative draft
|
||||
|
||||
# DeepSeek V4 PRO (512 GB / distributed)
|
||||
ds4-download-model pro-q2-imatrix # single-file PRO q2
|
||||
ds4-download-model pro-q4-split # both halves of PRO Q4 split
|
||||
|
||||
# GLM 5.2
|
||||
ds4-download-model glm-unsloth-q4 # Unsloth UD-Q4_K_XL, 11 shards
|
||||
ds4-download-model glm-antirez-iq2xxs # routed IQ2_XXS, reduced-memory
|
||||
ds4-download-model glm-antirez-q2 # routed Q2_K, ~262 GB
|
||||
ds4-download-model glm-antirez-q4 # routed Q4_K, ~434 GB
|
||||
|
||||
ds4-download-model --help # full target list
|
||||
```
|
||||
|
||||
Pick by machine memory: `ds4f-q2` (96/128 GB), `ds4f-q4` (>=256 GB),
|
||||
`pro-*` (512 GB / distributed), `glm-*` (per-target sizes above). The small
|
||||
Flash quants download via `curl`; the MXFP4, PRO, and GLM files use the `hf`
|
||||
CLI (bundled in the package via `huggingface-hub` + `hf-xet`), which
|
||||
`ds4-download-model` puts on its PATH automatically.
|
||||
|
||||
## 2. Run it
|
||||
|
||||
```sh
|
||||
# interactive chat (defaults to ./ds4flash.gguf in the current dir)
|
||||
ds4
|
||||
|
||||
# explicit model path
|
||||
ds4 -m /path/to/gguf/DeepSeek-V4-Flash-IQ2XXS-...-imatrix-0731.gguf
|
||||
|
||||
# DSpark speculative decoding (greedy only; needs the ds4f-dspark support GGUF)
|
||||
ds4 -m ./ds4flash.gguf \
|
||||
--dspark --mtp ./gguf/DeepSeek-V4-Flash-DSpark-support-0731.gguf --temp 0
|
||||
|
||||
# GLM 5.2 (experimental greedy MTP via --glm-mtp)
|
||||
ds4 -m gguf/GLM-5.2-UD-IQ2_XXS_RoutedIQ2XXS_blk78Q2K.gguf --glm-mtp-timing --temp 0
|
||||
|
||||
# HTTP server on the LAN
|
||||
ds4-server -m ./ds4flash.gguf \
|
||||
--ctx 100000 --kv-disk-dir ./kv --kv-disk-space-mb 8192 --host 0.0.0.0
|
||||
```
|
||||
|
||||
Then point a client at `http://<host>:8000/v1` (endpoints: `/v1/chat/completions`,
|
||||
`/v1/messages`, `/v1/responses`, ...). Use `--cors` for browser clients.
|
||||
|
||||
## Backend notes
|
||||
|
||||
- **rocm** targets a specific GPU arch (default `gfx1151`, AMD Strix Halo). At
|
||||
runtime the user needs `/dev/kfd` + render-node access, and large models need
|
||||
the GTT memory kernel params from upstream's `STRIXHALO.md`. On Strix Halo,
|
||||
export `HSA_ENABLE_SDMA=0` (SDMA is buggy on its unified memory).
|
||||
- **cuda** is unfree (CUDA closure) and needs an NVIDIA driver at runtime.
|
||||
- **cpu** is a reference/debug path only — not for production inference.
|
||||
|
||||
## Maintenance
|
||||
|
||||
This tracks upstream `main` (no releases). To bump, set `rev` in `default.nix`
|
||||
and refresh `hash`. Binaries are built per-host (`-march=native`), so build each
|
||||
GPU variant on its target host. See `default.nix`'s header comment for details.
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
# Bump superset-desktop to a new version.
|
||||
# Usage: ./update.sh [<version>]
|
||||
# With version: bump to that version.
|
||||
# Without args: auto-detect latest from GitHub releases.
|
||||
set -euo pipefail
|
||||
|
||||
PKG="superset-desktop"
|
||||
REPO="superset-sh/superset"
|
||||
URL_TEMPLATE="https://github.com/superset-sh/superset/releases/download/desktop-v\${VERSION}/superset-\${VERSION}-x86_64.AppImage"
|
||||
|
||||
if [ $# -ge 1 ]; then
|
||||
VERSION="$1"
|
||||
else
|
||||
echo "Auto-detecting latest superset-desktop version..."
|
||||
VERSION=$(curl -fsSL "https://api.github.com/repos/${REPO}/releases" \
|
||||
| jq -r '[.[] | select(.tag_name | startswith("desktop-v")) | .tag_name | sub("^desktop-v"; "")] | .[0]')
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "Could not auto-detect latest version from GitHub."
|
||||
echo "Usage: $0 [<version>]"
|
||||
exit 1
|
||||
fi
|
||||
echo "Latest: $VERSION"
|
||||
fi
|
||||
|
||||
URL=$(eval "echo $URL_TEMPLATE")
|
||||
|
||||
sed -i "s/version = \".*\";/version = \"${VERSION}\";/" default.nix
|
||||
|
||||
HASH=$(nix hash file --type sha256 --sri <(curl -fsSL "$URL"))
|
||||
sed -i "s|hash = \".*\";|hash = \"${HASH}\";|" default.nix
|
||||
|
||||
echo "✅ ${PKG} bumped to ${VERSION}"
|
||||
Reference in new issue
Block a user