From e555375a11fa177252a4e7fccedce46caf93f923 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Mon, 8 Sep 2025 20:43:11 +0200 Subject: [PATCH] python3Packages.bitsandbytes: fix non-CUDA build --- pkgs/development/python-modules/bitsandbytes/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/bitsandbytes/default.nix b/pkgs/development/python-modules/bitsandbytes/default.nix index a70ed26e6137..d1767fa005be 100644 --- a/pkgs/development/python-modules/bitsandbytes/default.nix +++ b/pkgs/development/python-modules/bitsandbytes/default.nix @@ -83,6 +83,8 @@ buildPythonPackage { nativeBuildInputs = [ cmake + ] + ++ lib.optionals cudaSupport [ cudaPackages.cuda_nvcc ]; @@ -96,7 +98,7 @@ buildPythonPackage { cmakeFlags = [ (lib.cmakeFeature "COMPUTE_BACKEND" (if cudaSupport then "cuda" else "cpu")) ]; - CUDA_HOME = "${cuda-native-redist}"; + CUDA_HOME = lib.optionalString cudaSupport "${cuda-native-redist}"; NVCC_PREPEND_FLAGS = lib.optionals cudaSupport [ "-I${cuda-native-redist}/include" "-L${cuda-native-redist}/lib"