# What a NixOS test machine has to be given before Hyprland 0.56.2 will start. # # Imported by both VM checks. It is a machine definition, not a test: nothing # here relaxes anything either check asserts, it only supplies hardware and # session facts that a default `nodes.machine` does not have. # # The failure it fixes is the same one every time -- the compositor aborts with # # terminate called after throwing an instance of 'std::runtime_error' # what(): CBackend::create() failed! # # and systemd restarts it until the test's timeout expires. `CBackend::create()` # is aquamarine's, and reading aquamarine 0.15.1 rather than guessing at it, it # needs three separate things. Two of them are hardware the bare test machine # does not have and are the blocks below; the third -- a seat that is not bound # to a VT -- is true of this session on any host, so it lives in nix/module.nix # as `SEATD_VTBOUND=0` on the compositor unit rather than here. # # A note for whoever hits this next: none of it is visible in the journal until # you also set `debug:disable_logs = false`, because Hyprland mutes aquamarine # by default and the abort is all that survives. That is how the three causes # were separated. { ... }: { # 1. A DRM render node. # # `virtualisation.graphics = false` still leaves QEMU's default bochs-drm # adapter in the guest, which offers /dev/dri/card0 and *no* renderD*. Measured # in the guest, not assumed: # # (default) card0 (bochs-drm) # -vga virtio card0, renderD128 (virtio_gpu) # -device virtio-gpu-pci card0, card1, renderD128 (bochs + virtio) # -vga none -device virtio-gpu-pci card0, renderD128 (virtio_gpu) # # `-vga virtio` *replaces* the default adapter, so it is the one-option form of # the last line. `-device virtio-gpu-pci` on its own only *adds* a second card # next to bochs-drm, so it would need `-vga none` beside it to leave the guest # with a single DRM device. virtualisation.qemu.options = [ "-vga virtio" ]; # 2. Mesa, where the GBM loader looks for it. # # aquamarine's allocator is gbm_create_device() on that node. On NixOS the GBM # backends live under /run/opengl-driver, which only exists when # hardware.graphics is enabled -- a test machine has it off. Without it: # # MESA-LOADER: failed to open dri: /run/opengl-driver/lib/gbm/dri_gbm.so: # cannot open shared object file: No such file or directory # ERR from aquamarine ]: Couldn't open a GBM device at fd 21 # CRIT from aquamarine ]: Cannot open backend: no allocator available hardware.graphics.enable = true; }