]> git.giacomolli.uk - onechat/blobdiff - nix/package.nix
Include the small model in the Nix package
[onechat] / nix / package.nix
index 41cd24f8e0782767d6b8515b51776f4ed7fc2120..c3fa562a93c7f3975000e66b5848a2328d30fd0b 100644 (file)
@@ -3,13 +3,22 @@
   buildGoModule,
   src,
   version,
+  callPackage,
+  whisper-cpp,
 }:
+let
+  model = (callPackage ./voice-model.nix { }).small;
+in
 buildGoModule {
   pname = "onechat";
   inherit src version;
 
   subPackages = [ "." ];
-  ldflags = [ "-X main.version=${version}" ];
+  ldflags = [
+    "-X main.version=${version}"
+    "-X main.voiceTranscriberPath=${whisper-cpp}/bin/whisper-cli"
+    "-X main.voiceModelPath=${model}"
+  ];
   vendorHash = "sha256-nRDUAGSXAK5/L2xyfDh3NbMOZmrGGEIm4vtgfWsxHYU=";
 
   # The flake check runs the full replay.