From 406509dc549cb58d788a3dbd5572f28008c84546 Mon Sep 17 00:00:00 2001 From: Vika Date: Wed, 4 Sep 2024 22:15:32 +0300 Subject: Make LLM enhancements optional --- default.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'default.nix') 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 -- cgit 1.4.1