summaryrefslogtreecommitdiffstats
path: root/nixos/tests/common/openxr.nix
blob: 53b48d10e5fb6ffaaf3f312f5ecb4035ac3908a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
  lib,
  pkgs,
  config,
  ...
}:

{
  imports = [
    ./user-account.nix
    ./x11.nix
  ];
  test-support.displayManager.auto.user = "alice";
  systemd.user.targets.xdg-desktop-autostart = {
    wantedBy = [ "graphical-session.target" ];
    after = [ "graphical-session.target" ];
  };

  hardware.graphics.enable = true;

  services.monado = {
    enable = true;
    defaultRuntime = true;
    forceDefaultRuntime = true;
  };
  systemd.user.services.monado = {
    requires = [ "graphical-session.target" ];
    environment = {
      # Stop Monado from probing for any hardware
      SIMULATED_ENABLE = "1";
      SIMULATED_LEFT = "simple";
      SIMULATED_RIGHT = "simple";
      # Run as X11 client rather than using direct mode
      XRT_COMPOSITOR_FORCE_XCB = "1";
      # And run fullscreen so that we can hide the DE
      XRT_COMPOSITOR_XCB_FULLSCREEN = "1";
    };
  };
}