1import ./make-test-python.nix ({ pkgs, ... }: {
2 name = "monado";
3
4 nodes.machine =
5 { pkgs, ... }:
6
7 {
8 hardware.opengl.enable = true;
9 users.users.alice = {
10 isNormalUser = true;
11 uid = 1000;
12 };
13
14 services.monado = {
15 enable = true;
16 defaultRuntime = true;
17 };
18 # Stop Monado from probing for any hardware
19 systemd.user.services.monado.environment.SIMULATED_ENABLE = "1";
20
21 environment.systemPackages = with pkgs; [ openxr-loader ];
22 };
23
24 testScript = { nodes, ... }:
25 let
26 userId = toString nodes.machine.users.users.alice.uid;
27 runtimePath = "/run/user/${userId}";
28 in
29 ''
30 machine.succeed("loginctl enable-linger alice")
31 machine.wait_for_unit("user@${userId}.service")
32
33 machine.wait_for_unit("monado.socket", "alice")
34 machine.systemctl("start monado.service", "alice")
35 machine.wait_for_unit("monado.service", "alice")
36
37 machine.succeed("su -- alice -c env XDG_RUNTIME_DIR=${runtimePath} openxr_runtime_list")
38 '';
39})