1 # Global configuration for the SSH client.
3 { config, lib, pkgs, ... }:
6 cfg = config.programs.turbovnc;
13 ensureHeadlessSoftwareOpenGL = lib.mkOption {
14 type = lib.types.bool;
17 Whether to set up NixOS such that TurboVNC's built-in software OpenGL
20 This will enable {option}`hardware.graphics.enable` so that OpenGL
21 programs can find Mesa's llvmpipe drivers.
23 Setting this option to `false` does not mean that software
24 OpenGL won't work; it may still work depending on your system
27 This option is also intended to generate warnings if you are using some
28 configuration that's incompatible with using headless software OpenGL
37 config = lib.mkIf cfg.ensureHeadlessSoftwareOpenGL {
39 # TurboVNC has builtin support for Mesa llvmpipe's `swrast`
40 # software rendering to implement GLX (OpenGL on Xorg).
41 # However, just building TurboVNC with support for that is not enough
42 # (it only takes care of the X server side part of OpenGL);
43 # the indiviudual applications (e.g. `glxgears`) also need to directly load
45 # Thus, this creates `/run/opengl-driver` populated by Mesa so that the applications
46 # can find the llvmpipe `swrast.so` software rendering DRI lib via `libglvnd`.
47 # This comment exists to explain why `hardware.` is involved,
48 # even though 100% software rendering is used.
49 hardware.graphics.enable = true;