Bluetooth MIDI?

ETA: I’m using nixpkgs-unstable.

I’m trying to enable Bluetooth MIDI on my desktop, which basically involves specifying a BlueZ package that has it enabled. I found this old PR, but it’s either deprecated or I don’t know how to apply the override.

I believe that BlueZ-ALSA has a MIDI-enabled profile, but I’m not sure if that would be compatible with my pipewire config or if it would maybe even hog the audio server when I’m trying to use Reaper? That would be unusable because I need Bluetooth MIDI for Reaper.

Does anyone have experience with this sort of thing? I tried doing this, and I end up getting an anonymous lambda + unexpected arg error:

hardware.bluetooth = {
  enable = true;
  package = pkgs.bluez;
};
...

environment.systemPackages = with pkgs; [
  (bluez.override { enableMidi = true; })
];

Disclaimer: I typed this from memory after removing the code from my config, so it might have a typo or something.

So I might be a big dumb dummy because I skimmed the BlueZ package in nixpkgs (nixpkgs/.../bluez/package.nix) and it very clearly has MIDI enabled by default.

I just tossed these lines into my config and it worked, though I had to fumble around for a bit and connect my Bluetooth MIDI controller(s) to Reaper’s virtual MIDI input in qpwgraph. Works great now :man_shrugging:

  # Enable Bluetooth
  hardware.bluetooth.enable = true;
  ...
  environment.systemPackages = with pkgs; [
    ...
    bluez
    ...
  ];