Files
nix/packages/llama-cpp/default.nix
Evan Reichard 8e1a2ad85a feat: add claude-code package
- Add Nix package for @anthropic-ai/claude-code (v2.1.59)
- Add package-lock.json with optional dependencies for all platforms
- Include update script for automated version updates
- Add module integration with custom package reference
- Rename claude shell alias to claude-custom

Refs: https://github.com/anthropics/claude-code
2026-02-26 08:49:13 -05:00

35 lines
931 B
Nix

{ pkgs }:
(pkgs.llama-cpp.override {
cudaSupport = true;
blasSupport = true;
rocmSupport = false;
metalSupport = false;
vulkanSupport = true;
}).overrideAttrs
(oldAttrs: rec {
version = "8157";
src = pkgs.fetchFromGitHub {
owner = "ggml-org";
repo = "llama.cpp";
tag = "b${version}";
hash = "sha256-3u9BWMZGGL3RTWxlEl5swOBe4yDoBAEfz/m2b1hw6fc=";
leaveDotGit = true;
postFetch = ''
git -C "$out" rev-parse --short HEAD > $out/COMMIT
find "$out" -name .git -print0 | xargs -0 rm -rf
'';
};
# Auto CPU Optimizations
cmakeFlags = (oldAttrs.cmakeFlags or [ ]) ++ [
"-DGGML_CUDA_ENABLE_UNIFIED_MEMORY=1"
"-DCMAKE_CUDA_ARCHITECTURES=61;86" # GTX 1070 / GTX 1080ti / RTX 3090
];
# Disable Nix's march=native Stripping
preConfigure = ''
export NIX_ENFORCE_NO_NATIVE=0
${oldAttrs.preConfigure or ""}
'';
})