summary refs log tree commit diff
path: root/default.nix
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2024-09-04 22:15:32 +0300
committerVika <vika@fireburn.ru>2024-09-04 22:15:32 +0300
commit406509dc549cb58d788a3dbd5572f28008c84546 (patch)
treeaff6115c0bfbd12ca447503d6d850feccfd9ad89 /default.nix
parentf16cac2d35487b1772d1c2524ed223c779f45f23 (diff)
downloadbowl-406509dc549cb58d788a3dbd5572f28008c84546.tar.zst
Make LLM enhancements optional
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix10
1 files changed, 7 insertions, 3 deletions
diff --git a/default.nix b/default.nix
index d406776..881b656 100644
--- a/default.nix
+++ b/default.nix
@@ -3,6 +3,8 @@
 , desktop-file-utils
 , gtk4, libadwaita, libpanel, libsoup_3, libsecret
 , librsvg, glib-networking
+
+, withLLMEnhancements ? true
 }:
 
 let
@@ -29,8 +31,6 @@ let
     };
     strictDeps = true;
 
-    # cargoExtraArgs can be used to inject features
-
     buildInputs = [
       gtk4 libadwaita libsoup_3 libsecret
       librsvg glib-networking
@@ -43,7 +43,9 @@ let
       platforms = ["aarch64-linux" "x86_64-linux"];
       mainProgram = "bowl";
     };
-  };
+  } // (lib.optionalAttrs (!withLLMEnhancements) {
+    cargoExtraArgs = lib.optionalString (!withLLMEnhancements) "--no-default-features";
+  });
 
   cargoArtifacts = craneLib.buildDepsOnly args;
   args' = args // { inherit cargoArtifacts; };
@@ -69,6 +71,8 @@ in craneLib.mkCargoDerivation (args' // {
   checkPhase = "mesonCheckPhase";
   installPhase = "mesonInstallPhase";
 
+  mesonFlags = lib.optional (!withLLMEnhancements) "-Dllm=false";
+
   nativeBuildInputs = args'.nativeBuildInputs ++ [
     rustc # Only needed for Meson to successfully detect the Rust toolchain