Files
millerson-overlay.nix/packages/ds4/package.nix
Alexander Miroshnichenko 1f3f0f468b
Some checks failed
CI / check (push) Has been cancelled
chore: update all packages to latest versions
- aionui 2.1.4 -> 2.1.50
- desloppify 0.9.15 -> 1.0
- ds4 -> 2026-08-05 (b030961)
- freebuff 0.0.85 -> 0.0.142 (binary moved to GitHub releases)
- graphify 0.7.10 -> 0.9.35 (license Apache-2.0, fix sed patterns for versioned deps)
- hipengine 0.2.2 -> 0.3.0 (console script renamed to hipengine)
- kubernetes-mcp-server 0.0.62 -> 0.0.66 (requires go >= 1.26.3)
- mcp-gateway 2.11.0 -> 3.4.0 (requires rustc >= 1.95)
- omniroute 3.8.28 -> 3.8.49
- radar 1.6.1 -> 1.9.1 (drop obsolete lockfile sed patch)
- relay-free-llm -> 96e6c48, cerebras-cloud-sdk 1.67.0 -> 1.91.0
- stakpak 0.3.86 -> 0.3.88

Add nixpkgs-latest input for toolchains newer than the pinned nixpkgs.
2026-08-07 16:04:10 +03:00

103 lines
3.0 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
gnumake,
rocmPackages,
autoPatchelfHook,
}:
stdenv.mkDerivation {
pname = "ds4";
version = "0-unstable-2026-08-05";
src = fetchFromGitHub {
owner = "antirez";
repo = "ds4";
rev = "b0309611041655f4e45671cfd9c9886aff161406";
hash = "sha256-yBPQqX8oI9fElGiXfz72iWwIS8ZQpK4Bl9TWLZSa6JU=";
};
nativeBuildInputs = [
gnumake
rocmPackages.hipcc
autoPatchelfHook
];
buildInputs = [
rocmPackages.clr
rocmPackages.hipblas
rocmPackages.hipblas-common
rocmPackages.hipblaslt
rocmPackages.hipcub
rocmPackages.rocblas
rocmPackages.rocprim
rocmPackages.rocwmma
];
# STRIXHALO.md: rocwmma/internal/ headers may be missing in distro packages.
# nixpkgs builds rocwmma from source so all headers (including internal/) are present.
# ROCM_ARCH defaults to gfx1151 (Strix Halo / Radeon 8060S) in the upstream Makefile.
buildPhase = ''
runHook preBuild
make strix-halo -j"$NIX_BUILD_CORES" \
HIPCC="${rocmPackages.hipcc}/bin/hipcc" \
ROCM_CFLAGS="-O3 -ffast-math -g -fno-finite-math-only -pthread -D__HIP_PLATFORM_AMD__ -Wno-unused-command-line-argument --offload-arch=gfx1151 \
-I${rocmPackages.clr}/include \
-I${rocmPackages.hipblas}/include \
-I${rocmPackages.hipblas-common}/include \
-I${rocmPackages.hipblaslt}/include \
-I${rocmPackages.hipcub}/include \
-I${rocmPackages.rocblas}/include \
-I${rocmPackages.rocprim}/include \
-I${rocmPackages.rocwmma}/include" \
ROCM_LDLIBS="-lm -pthread \
-L${rocmPackages.hipblas}/lib -lhipblas \
-L${rocmPackages.hipblaslt}/lib -lhipblaslt \
-L${rocmPackages.rocblas}/lib -lrocblas \
-L${rocmPackages.clr}/lib -lamdhip64"
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp ds4 ds4-server ds4-bench ds4-eval ds4-agent $out/bin/
runHook postInstall
'';
passthru = {
category = "AI Inference";
updateScript = [
"nix-update"
"--flake"
"--version=branch=main"
".#ds4"
];
};
meta = {
description = "DeepSeek 4 Flash and PRO local inference engine for ROCm (Strix Halo)";
longDescription = ''
DS4 is a self-contained local inference engine specifically built for
DeepSeek V4 Flash and PRO. It bundles a CLI, HTTP server, and native
coding agent. This package is built with the ROCm backend for AMD
Strix Halo GPUs (gfx1151, Radeon 8060S).
Runtime requirements (from STRIXHALO.md):
- User must be in 'render' and 'video' groups for /dev/kfd and DRM access
- GPU-visible memory must be increased via kernel parameters:
amd_iommu=off amdgpu.gttsize=126976 ttm.pages_limit=32505856 ttm.page_pool_size=32505856
'';
homepage = "https://github.com/antirez/ds4";
changelog = "https://github.com/antirez/ds4/commits/main";
license = lib.licenses.mit;
platforms = [ "x86_64-linux" ];
mainProgram = "ds4";
};
}