Emacs Overlay + Yabai on Darwin

I managed to figure out the problem!

I was launching emacs using emacs or emacsclient from a shell, but doing so does not work correctly with Yabai. However, nixpkgs also builds a macOS app for Emacs (which I didn’t realize before). If I launch via the app, Yabai tiles it correctly (note that I’m still using the patch mentioned above though, so that might be required as well).

I’m solving the problem by aliasing emacs to the macOS app via the following snippet in my home-manager config:

programs.zsh = {
 enable = true;
 shellAliases = {
   emacs = "${your-emacs-package}/Applications/Emacs.app/Contents/MacOS/Emacs";
 };
};