If OpenGL is enabled without X11, the build fails with:
In file included from /nix/store/<...>-libglvnd-1.3.1-dev/include/EGL/egl.h:39,
from cairo-gl.h:130,
from cairo-gl-private.h:51,
from cairo-gl-composite.c:48:
/nix/store/<...>-libglvnd-1.3.1-dev/include/EGL/eglplatform.h:128:10: fatal error: X11/Xlib.h: No such file or directory
128 | #include <X11/Xlib.h>
| ^~~~~~~~~~~~
compilation terminated.