summary refs log tree commit diff
path: root/default.nix
diff options
context:
space:
mode:
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