Can anyone get whisper-overlay working?

I want to have a push-to-talk speech-to-text dictation service. I found this (GitHub - oddlama/whisper-overlay: A wayland overlay providing speech-to-text functionality for any application via a global push-to-talk hotkey) and it seems promising, but I am running NixOS unstable on Python 3.13 and it seems to want Python 3.12.

Has anyone got it working?

Could you explain what you mean and/or why this is a problem? Does this flake provide a follows?

Yes it does:

{
  inputs = {
    # ...
    whisper-overlay.url = "github:oddlama/whisper-overlay";
    whisper-overlay.inputs.nixpkgs.follows = "nixpkgs";
  };
}

I followed these instructions:

# This is a NixOS config module
{
  imports = [
    inputs.whisper-overlay.nixosModules.default
  ];

  # Also make sure to enable cuda support in nixpkgs, otherwise transcription will
  # be painfully slow. But be prepared to let your computer build packages for 2-3 hours.
  nixpkgs.config.cudaSupport = true;

  # Start the service and expose the port to your local network.
  services.realtime-stt-server.enable = true;
  services.realtime-stt-server.openFirewall = true;

  # If you are running this system-wide on your local machine,
  # Add the whisper-overlay package so you can start the overlayit manually.
  # Alternatively add it to the autostart of your display environment or window manager.
  environment.systemPackages = [pkgs.whisper-overlay];
}

Here is the result:

error:
       … while calling the 'head' builtin
         at /nix/store/jc3mfa7ybzh32bkvdj5xiib1vkx8jy6x-source/lib/attrsets.nix:1701:13:
         1700|           if length values == 1 || pred here (elemAt values 1) (head values) then
         1701|             head values
             |             ^
         1702|           else

       … while evaluating the attribute 'value'
         at /nix/store/jc3mfa7ybzh32bkvdj5xiib1vkx8jy6x-source/lib/modules.nix:1118:7:
         1117|     // {
         1118|       value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |       ^
         1119|       inherit (res.defsFinal') highestPrio;

       … while evaluating the option `system.build.toplevel':

       … while evaluating definitions from `/nix/store/jc3mfa7ybzh32bkvdj5xiib1vkx8jy6x-source/nixos/modules/system/activation/top-level.nix':

       … while evaluating the option `warnings':

       … while evaluating definitions from `/nix/store/jc3mfa7ybzh32bkvdj5xiib1vkx8jy6x-source/nixos/modules/system/boot/systemd.nix':

       … while evaluating the option `systemd.services.realtime-stt-server.serviceConfig':

       … while evaluating definitions from `/nix/store/1ck7067fh2r7ba7nmh60azsw6rwml711-source/nix/nixosModules/realtime-stt-server.nix':

       … while evaluating definitions from `/nix/store/1ck7067fh2r7ba7nmh60azsw6rwml711-source/nix/packages/realtime-stt-server.nix, via option perSystem':

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: python3.13-realtime-stt-0.1.16 does not configure a `format`. To build with setuptools as before, set `pyproject = true` and `build-system = [ setuptools ]`.`
Command 'nix --extra-experimental-features 'nix-command flakes' build --print-out-paths '.#nixosConfigurations."framework".config.system.build.toplevel' --no-link' returned non-zero exit status 1.
~

The error message doesn’t seem to say anything about python 3.12, what convinced you in your initial post that 3.12 vs 3.13 is the problem?

This seems to be from nixpkgs/pkgs/development/interpreters/python/mk-python-derivation.nix at df3de70468b743b371a7191ea61d1040fe3bf399 · NixOS/nixpkgs · GitHub and seems to be related to python setuptools. (git) blaming that line shows buildPython*: throw on empty format · NixOS/nixpkgs@d2e9be2 · GitHub. You probably need to patch the realtime-stt derivation provided by the repo you linked to deal with the new check, or use a version of nixpkgs with the old definition of mk-python-derivation

ChatGTP.

Any tips? This is a bit beyond me.

If you are going to use ChatGPT, I feel that it would be helpful to just post that ChatGPT is telling you “xyz”. It increases the chance that someone trying to help you doesn’t waste time going down a weird path, and so actually gets around to helping you instead of giving up early.

From the errors you posted:

The instructions from the error seem pretty clear about a suggestion, try following it with the derivation that is defined in realtime-stt-server.nix.

EDIT: you probably actually want to edit whisper-overlay/nix/packages/realtime-stt.nix at b851520617887f09be614a990b2d50caba093525 · oddlama/whisper-overlay · GitHub, which is the one that calls buildPythonPackage

1 Like

Alternatively just open an issue on the repo and wait.