im gonna die

This commit is contained in:
2026-02-26 21:01:53 -05:00
parent a2fd8acc07
commit a92363a211
6 changed files with 103 additions and 14 deletions

View File

@@ -20,6 +20,61 @@
];
nix.package = pkgs.lixPackageSets.stable.lix;
nixpkgs.config.packageOverrides = pkgs: {
# Stolen from https://www.nijho.lt/post/llama-nixos/
llama-cpp =
(pkgs.llama-cpp.override {
cudaSupport = true;
rocmSupport = false;
metalSupport = false;
# Enable BLAS for optimized CPU layer performance (OpenBLAS)
# This is crucial for models using split-mode or CPU offloading
blasSupport = true;
}).overrideAttrs
(oldAttrs: rec {
version = "8162";
src = pkgs.fetchFromGitHub {
owner = "ggml-org";
repo = "llama.cpp";
tag = "b${version}";
hash = "sha256-Tn6Trhvmm+n7qyjSOD6WpnZmEHGrkHqZE6I0HQE1TPY=";
leaveDotGit = true;
postFetch = ''
git -C "$out" rev-parse --short HEAD > $out/COMMIT
find "$out" -name .git -print0 | xargs -0 rm -rf
'';
};
# Enable native CPU optimizations for massively better CPU performance
# This enables AVX, AVX2, AVX-512, FMA, etc. for your specific CPU
# NOTE: This is intentionally opposite of nixpkgs (which uses -DGGML_NATIVE=off
# for reproducible builds). We sacrifice portability for faster CPU layers.
cmakeFlags = (oldAttrs.cmakeFlags or [ ]) ++ [
"-DGGML_NATIVE=ON"
"-DCMAKE_CUDA_ARCHITECTURES=86" # RTX 3090 - needed since sandbox has no GPU
];
# Disable Nix's NIX_ENFORCE_NO_NATIVE which strips -march=native flags
# See: https://github.com/NixOS/nixpkgs/issues/357736
# See: https://github.com/NixOS/nixpkgs/pull/377484 (intentionally contradicts this)
preConfigure = ''
export NIX_ENFORCE_NO_NATIVE=0
${oldAttrs.preConfigure or ""}
'';
});
# llama-swap from GitHub releases
llama-swap = pkgs.runCommand "llama-swap" { } ''
mkdir -p $out/bin
tar -xzf ${
pkgs.fetchurl {
url = "https://github.com/mostlygeek/llama-swap/releases/download/v190/llama-swap_190_linux_amd64.tar.gz";
hash = "sha256-WAfmJ4YiVH/UYq++l2Ut6oLqkd270HgG7eV+6FG/0Oc=";
}
} -C $out/bin
chmod +x $out/bin/llama-swap
'';
};
# 🇺🇸
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
@@ -57,7 +112,7 @@
jack.enable = true;
};
programs.adb.enable = true; # Bit heavy but you never know when you might need it...
# programs.adb.enable = true; # Bit heavy but you never know when you might need it...
users.users.laythe = {
isNormalUser = true;
@@ -114,7 +169,7 @@
winetricks
gparted
unrar
electrum
# electrum
qpwgraph
libimobiledevice
ifuse
@@ -144,6 +199,7 @@
xmodmap
nixfmt
units
android-tools
];
services.usbmuxd = {