Gnucash: crashes with `Error 71 (Protocol error) dispatching to Wayland display` when viewing reports

I’m running NixOS 25.11 with NVidia 580.119.02 and Kernel 6.18.6. I’ve installed GnuCash 5.14 from nixpkgs. It starts fine, but as soon as I try to generate a report it crashes with this error:

Error 71 (Protocol error) dispatching to Wayland display

The only workaround I found online was this: GSK_RENDERER=ngl gnucash. But that didn’t help.

I’ve been using GnuCash on Ubuntu for many years (also with Wayland), up to version 5.10 and didn’t have this issue. Is this something NixOS specific?

OK, finally found the corresponding GnuCash bug report (their bugzilla is currently closed, which makes it hard to find and view): Log in to Bugzilla

There’s also an upstream WebKit bug report: 280210 – [GTK] Unable to start: Error 71 (Protocol error) dispatching to Wayland display . It contains 3 workarounds that actually work:

WEBKIT_DISABLE_COMPOSITING_MODE=1 gnucash
WEBKIT_DISABLE_DMABUF_RENDERER= gnucash
__NV_DISABLE_EXPLICIT_SYNC=1 gnucash

The last one should give the best rendering performance, although that doesn’t really matter for GnuCash.

So, I guess I’ll wrap the gnucash package to always set the environment variable.