nixosTests/stardust-xr-{atmosphere,flatland}: init

This commit is contained in:
Gavin John
2025-10-29 01:51:50 -07:00
parent a4fadc4ac8
commit 020d438901
4 changed files with 136 additions and 0 deletions

View File

@@ -1582,6 +1582,8 @@ in
sssd-ldap = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./sssd-ldap.nix { };
sssd-legacy-config = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./sssd-legacy-config.nix { };
stalwart = runTest ./stalwart/stalwart.nix;
stardust-xr-atmosphere = runTest ./stardust-xr/atmosphere.nix;
stardust-xr-flatland = runTest ./stardust-xr/flatland.nix;
stargazer = runTest ./web-servers/stargazer.nix;
starship = runTest ./starship.nix;
startx = import ./startx.nix { inherit pkgs runTest; };

View File

@@ -0,0 +1,54 @@
{ ... }:
{
name = "stardust-xr-atmosphere";
# Doesn't understand @polling_condition
skipTypeCheck = true;
nodes.machine =
{
lib,
pkgs,
config,
...
}:
{
imports = [ ./common.nix ];
virtualisation.memorySize = 4096;
systemd.user.services.stardust-xr-atmosphere = {
wantedBy = [ "xdg-desktop-autostart.target" ];
requires = [ "stardust-xr-server.service" ];
after = [ "stardust-xr-server.service" ];
script = ''
set -eufx pipefail
${lib.getExe pkgs.stardust-xr-atmosphere} install ${pkgs.stardust-xr-atmosphere}/share/atmosphere/default_envs/the_grid
${lib.getExe pkgs.stardust-xr-atmosphere} set-default the_grid
${lib.getExe pkgs.stardust-xr-atmosphere} show
'';
environment.RUST_BACKTRACE = "full";
};
};
testScript =
{ nodes, ... }:
''
@polling_condition()
def atmosphere_running():
machine.wait_for_unit("stardust-xr-atmosphere.service", "alice")
with subtest("Ensure X11 starts"):
start_all()
machine.succeed("loginctl enable-linger alice")
machine.wait_for_x()
with subtest("Ensure system works"):
with atmosphere_running:
# TODO(@Pandapip1): 20 seconds should be long enough for anything, but this is theoretically flaky
# Adding systemd notify support to stardust-xr-atmosphere should resolve this
machine.sleep(20)
machine.screenshot("screen")
'';
}

View File

@@ -0,0 +1,23 @@
{
lib,
pkgs,
...
}:
{
imports = [ ../common/openxr.nix ];
# TODO(@Pandapip1): For the time being, Stardust doesn't like controllers rather than hand tracking
services.monado.enable = lib.mkForce false;
systemd.user.services.stardust-xr-server = {
wantedBy = [ "xdg-desktop-autostart.target" ];
# requires = [ "monado.service" ];
serviceConfig = {
Type = "notify";
NotifyAccess = "all";
ExecStart = "${lib.getExe pkgs.stardust-xr-server} -e ${pkgs.writeShellScript "notifyReady" "systemd-notify --ready"}";
};
environment.RUST_BACKTRACE = "full";
};
}

View File

@@ -0,0 +1,57 @@
{ ... }:
{
name = "stardust-xr-flatland";
# Doesn't understand @polling_condition
skipTypeCheck = true;
nodes.machine =
{
lib,
pkgs,
config,
...
}:
{
imports = [ ./common.nix ];
systemd.user.services.stardust-xr-flatland = {
wantedBy = [ "xdg-desktop-autostart.target" ];
requires = [ "stardust-xr-server.service" ];
after = [ "stardust-xr-server.service" ];
script = lib.getExe pkgs.stardust-xr-flatland;
environment.RUST_BACKTRACE = "full";
};
systemd.user.services.test-wayland-app = {
wantedBy = [ "xdg-desktop-autostart.target" ];
requires = [ "stardust-xr-flatland.service" ];
after = [ "stardust-xr-flatland.service" ];
script = lib.getExe pkgs.wayland-colorbar;
environment = {
DISPLAY = "";
WAYLAND_DISPLAY = "wayland-0";
};
};
};
testScript =
{ nodes, ... }:
''
@polling_condition()
def wayland_client_running():
machine.wait_for_unit("test-wayland-app.service", "alice")
with subtest("Ensure X11 starts"):
start_all()
machine.succeed("loginctl enable-linger alice")
machine.wait_for_x()
with subtest("Ensure system works"):
with wayland_client_running:
# TODO: 20 seconds should be long enough for anything, but this is theoretically flaky
machine.sleep(20)
machine.screenshot("screen")
'';
}