diff --git a/maintainers/team-list.nix b/maintainers/team-list.nix index 4781b38d3f29..0e76eddde484 100644 --- a/maintainers/team-list.nix +++ b/maintainers/team-list.nix @@ -713,6 +713,15 @@ with lib.maintainers; github = "security-review"; }; + stardust-xr = { + members = [ + pandapip1 + technobaboo + ]; + scope = "Maintain Stardust XR packages"; + shortName = "StardustXR"; + }; + stdenv = { enableFeatureFreezePing = true; github = "stdenv"; diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index f87972292a44..7af84e8d32d3 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -1565,6 +1565,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; }; diff --git a/nixos/tests/common/openxr.nix b/nixos/tests/common/openxr.nix new file mode 100644 index 000000000000..53b48d10e5fb --- /dev/null +++ b/nixos/tests/common/openxr.nix @@ -0,0 +1,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"; + }; + }; +} diff --git a/nixos/tests/monado.nix b/nixos/tests/monado.nix index 609b0fa647e5..ab73471215b1 100644 --- a/nixos/tests/monado.nix +++ b/nixos/tests/monado.nix @@ -3,47 +3,57 @@ name = "monado"; nodes.machine = - { pkgs, ... }: + { + lib, + pkgs, + config, + ... + }: { - hardware.graphics.enable = true; - users.users.alice = { - isNormalUser = true; - uid = 1000; + imports = [ ./common/openxr.nix ]; + + systemd.user.services.print-openxr-info = { + wantedBy = [ "xdg-desktop-autostart.target" ]; + requires = [ "monado.service" ]; + script = lib.getExe' pkgs.openxr-loader "openxr_runtime_list"; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + }; }; - services.monado = { - enable = true; - defaultRuntime = true; - - forceDefaultRuntime = true; + systemd.user.services.xrgears = { + wantedBy = [ "xdg-desktop-autostart.target" ]; + requires = [ "monado.service" ]; + script = lib.getExe pkgs.xrgears; }; - # Stop Monado from probing for any hardware - systemd.user.services.monado.environment.SIMULATED_ENABLE = "1"; - - environment.systemPackages = with pkgs; [ openxr-loader ]; }; testScript = { nodes, ... }: - let - userId = toString nodes.machine.users.users.alice.uid; - runtimePath = "/run/user/${userId}"; - in '' - # for defaultRuntime - machine.succeed("stat /etc/xdg/openxr/1/active_runtime.json") + with subtest("Ensure X11 starts"): + start_all() + machine.succeed("loginctl enable-linger alice") + machine.wait_for_x() - machine.succeed("loginctl enable-linger alice") - machine.wait_for_unit("user@${userId}.service") + with subtest("Ensure default runtime present"): + machine.succeed("stat /etc/xdg/openxr/1/active_runtime.json") - machine.wait_for_unit("monado.socket", "alice") - machine.systemctl("start monado.service", "alice") - machine.wait_for_unit("monado.service", "alice") + with subtest("Ensure forced runtime present"): + # Monado needs to be started to create the forced runtime file + machine.systemctl("start monado.service", "alice") + machine.wait_for_unit("monado.service", "alice") + machine.succeed("stat /home/alice/.config/openxr/1/active_runtime.json") - # for forceDefaultRuntime - machine.succeed("stat /home/alice/.config/openxr/1/active_runtime.json") + with subtest("Ensure openxr_runtime_list can find runtime"): + machine.wait_for_unit("print-openxr-info.service", "alice") - machine.succeed("su -- alice -c env XDG_RUNTIME_DIR=${runtimePath} openxr_runtime_list") + with subtest("Ensure xrgears launches"): + machine.wait_for_unit("xrgears.service", "alice") + # TODO: 10 seconds should be long enough for anything, but this is theoretically flaky + machine.sleep(10) + machine.screenshot("screen") ''; } diff --git a/nixos/tests/stardust-xr/atmosphere.nix b/nixos/tests/stardust-xr/atmosphere.nix new file mode 100644 index 000000000000..7eb2f7b2778e --- /dev/null +++ b/nixos/tests/stardust-xr/atmosphere.nix @@ -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") + ''; +} diff --git a/nixos/tests/stardust-xr/common.nix b/nixos/tests/stardust-xr/common.nix new file mode 100644 index 000000000000..bbc5af59b772 --- /dev/null +++ b/nixos/tests/stardust-xr/common.nix @@ -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"; + }; +} diff --git a/nixos/tests/stardust-xr/flatland.nix b/nixos/tests/stardust-xr/flatland.nix new file mode 100644 index 000000000000..748a1e0cbd84 --- /dev/null +++ b/nixos/tests/stardust-xr/flatland.nix @@ -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") + ''; +} diff --git a/pkgs/by-name/st/stardust-xr-atmosphere/package.nix b/pkgs/by-name/st/stardust-xr-atmosphere/package.nix index 0c8d4703784c..692e83a85559 100644 --- a/pkgs/by-name/st/stardust-xr-atmosphere/package.nix +++ b/pkgs/by-name/st/stardust-xr-atmosphere/package.nix @@ -7,18 +7,26 @@ nix-update-script, }: -rustPlatform.buildRustPackage { +rustPlatform.buildRustPackage (finalAttrs: { pname = "stardust-xr-atmosphere"; - version = "0-unstable-2024-08-22"; + version = "0.51.1"; src = fetchFromGitHub { owner = "stardustxr"; repo = "atmosphere"; - rev = "0c8bfb91e8ca32a4895f858067334ed265517309"; - hash = "sha256-pk1+kkPV6fx+7Xz9hKFFVw402iztcvNC31zVCc3hfTY="; + tag = finalAttrs.version; + hash = "sha256-FH9Y+p17bGczRhLEfxVqc1peg9Aubw1pu7QOYb6RWvc="; }; - cargoHash = "sha256-eQjRbavmUW2iw0OEC/DPk2FflTc4QCn0K/c4Og+sGW4="; + cargoHash = "sha256-TVAm6BdIAE+gxWkpEUqF3R99UKhIGGSZK9qQ7urR7Uc="; + + postInstall = '' + mkdir -p $out/share/atmosphere + cp -r default_envs $out/share/atmosphere + ''; + + __structuredAttrs = true; + strictDeps = true; passthru = { tests.versionTest = testers.testVersion { @@ -26,9 +34,7 @@ rustPlatform.buildRustPackage { command = "atmosphere --version"; version = "stardust-xr-atmosphere 0.4.0"; }; - updateScript = nix-update-script { - extraArgs = [ "--version=branch" ]; - }; + updateScript = nix-update-script { }; }; meta = { @@ -36,10 +42,7 @@ rustPlatform.buildRustPackage { homepage = "https://stardustxr.org"; license = lib.licenses.mit; mainProgram = "atmosphere"; - maintainers = with lib.maintainers; [ - pandapip1 - technobaboo - ]; - platforms = lib.platforms.linux; + teams = with lib.teams; [ stardust-xr ]; + platforms = lib.platforms.unix; }; -} +}) diff --git a/pkgs/by-name/st/stardust-xr-flatland/fix-reify-test-signature.patch b/pkgs/by-name/st/stardust-xr-flatland/fix-reify-test-signature.patch new file mode 100644 index 000000000000..2df66fdae53e --- /dev/null +++ b/pkgs/by-name/st/stardust-xr-flatland/fix-reify-test-signature.patch @@ -0,0 +1,26 @@ +diff --git a/src/resize_handles.rs b/src/resize_handles.rs +index 0fcb071..69d2f2f 100644 +--- a/src/resize_handles.rs ++++ b/src/resize_handles.rs +@@ -451,7 +451,7 @@ impl CustomElement for ResizeHandles { + #[tokio::test] + async fn test_resize_handles() { + use serde::{Deserialize, Serialize}; +- use stardust_xr_asteroids::{client, ClientState, Migrate, Reify, Transformable}; ++ use stardust_xr_asteroids::{client, ClientState, Migrate, Reify, Tasker, Transformable}; + + // Simple test state + #[derive(Debug, Serialize, Deserialize)] +@@ -474,7 +474,11 @@ async fn test_resize_handles() { + const APP_ID: &'static str = "org.stardustxr.flatland.ResizeHandles"; + } + impl Reify for State { +- fn reify(&self) -> impl stardust_xr_asteroids::Element { ++ fn reify( ++ &self, ++ _context: &Context, ++ _tasks: impl Tasker, ++ ) -> impl stardust_xr_asteroids::Element { + stardust_xr_asteroids::elements::Spatial::default() + .rot(Quat::from_rotation_y(self.time / 10.0)) + .build() diff --git a/pkgs/by-name/st/stardust-xr-flatland/package.nix b/pkgs/by-name/st/stardust-xr-flatland/package.nix index 18e6eb4136e0..66b2bbe14b33 100644 --- a/pkgs/by-name/st/stardust-xr-flatland/package.nix +++ b/pkgs/by-name/st/stardust-xr-flatland/package.nix @@ -7,32 +7,32 @@ rustPlatform.buildRustPackage (finalAttrs: { pname = "stardust-xr-flatland"; - version = "0-unstable-2024-04-13"; + version = "0.51.1"; src = fetchFromGitHub { owner = "stardustxr"; repo = "flatland"; - rev = "b3b0f29c4ea1b82c96cf9de507837bf15a5e4c0e"; - hash = "sha256-m7c6XpmpTM1URuqMG2KqtaWbL2Vt8vJFJtmvq123BmY="; + tag = finalAttrs.version; + hash = "sha256-Gp2r6PJiyNb+augDwS/vGPJfwb5U6pVYgSyhS9QlggY="; }; + patches = [ ./fix-reify-test-signature.patch ]; + env.STARDUST_RES_PREFIXES = "${finalAttrs.src}/res"; - cargoHash = "sha256-oM4nQUEc3iq1x4uRp8Kw5WtE/L5b6VlLOfElMT9Tk98="; + cargoHash = "sha256-2LT/Szwzs83Poe7BojmUFh9yyUEhSgHmBR5QaO/BE4g="; - passthru.updateScript = nix-update-script { - extraArgs = [ "--version=branch" ]; - }; + __structuredAttrs = true; + strictDeps = true; + + passthru.updateScript = nix-update-script { }; meta = { description = "Flat window for Stardust XR"; homepage = "https://stardustxr.org"; license = lib.licenses.mit; mainProgram = "flatland"; - maintainers = with lib.maintainers; [ - pandapip1 - technobaboo - ]; - platforms = lib.platforms.linux; + teams = with lib.teams; [ stardust-xr ]; + platforms = lib.platforms.unix; }; }) diff --git a/pkgs/by-name/st/stardust-xr-gravity/package.nix b/pkgs/by-name/st/stardust-xr-gravity/package.nix index d45ce8f3f678..622fdd716393 100644 --- a/pkgs/by-name/st/stardust-xr-gravity/package.nix +++ b/pkgs/by-name/st/stardust-xr-gravity/package.nix @@ -5,32 +5,30 @@ nix-update-script, }: -rustPlatform.buildRustPackage { +rustPlatform.buildRustPackage (finalAttrs: { pname = "stardust-xr-gravity"; - version = "0-unstable-2024-12-29"; + version = "0.51.1"; src = fetchFromGitHub { owner = "stardustxr"; repo = "gravity"; - rev = "eca5e835cd3abee69984ce6312610644801457a9"; + tag = finalAttrs.version; hash = "sha256-upw0MjGccSI1B10wabKPMGrEo7ATfg4a7Hzaucbf99w="; }; + __structuredAttrs = true; + strictDeps = true; + cargoHash = "sha256-tkWY+dLFDnyir6d0supR3Z202p5i4UewY+J66mL1x/o="; - passthru.updateScript = nix-update-script { - extraArgs = [ "--version=branch" ]; - }; + passthru.updateScript = nix-update-script { }; meta = { description = "Utility to launch apps and stardust clients at an offet"; homepage = "https://stardustxr.org"; license = lib.licenses.mit; mainProgram = "gravity"; - maintainers = with lib.maintainers; [ - pandapip1 - technobaboo - ]; - platforms = lib.platforms.linux; + teams = with lib.teams; [ stardust-xr ]; + platforms = lib.platforms.unix; }; -} +}) diff --git a/pkgs/by-name/st/stardust-xr-kiara/package.nix b/pkgs/by-name/st/stardust-xr-kiara/package.nix deleted file mode 100644 index 56c18ed807f3..000000000000 --- a/pkgs/by-name/st/stardust-xr-kiara/package.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ - lib, - fetchFromGitHub, - rustPlatform, - makeBinaryWrapper, - niri, - stardust-xr-kiara, - testers, - nix-update-script, -}: - -rustPlatform.buildRustPackage (finalAttrs: { - pname = "stardust-xr-kiara"; - version = "0-unstable-2024-07-13"; - - src = fetchFromGitHub { - owner = "stardustxr"; - repo = "kiara"; - rev = "186b00a460c9dd8179f9af42fb9a420506ac3aff"; - hash = "sha256-e89/x66S+MpJFtqat1hYEyRVUYFjef62LDN2hQPjNVw="; - }; - - cargoHash = "sha256-C1eD974cEGbo0vHJqdnCPUopDPDDa6hAFJdzSm8t618="; - - nativeBuildInputs = [ makeBinaryWrapper ]; - - passthru = { - updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; }; - tests.helpTest = testers.runCommand { - name = "stardust-xr-kiara"; - script = '' - kiara --help - touch $out - ''; - nativeBuildInputs = [ stardust-xr-kiara ]; - }; - }; - - postInstall = '' - wrapProgram $out/bin/kiara --prefix PATH : ${niri}/bin - ''; - - env = { - NIRI_CONFIG = "${finalAttrs.src}/src/niri_config.kdl"; - STARDUST_RES_PREFIXES = "${finalAttrs.src}/res"; - }; - - meta = { - description = "360-degree app shell / DE for Stardust XR using Niri"; - homepage = "https://stardustxr.org/"; - license = lib.licenses.mit; - mainProgram = "kiara"; - maintainers = with lib.maintainers; [ - pandapip1 - technobaboo - ]; - platforms = lib.platforms.linux; - }; -}) diff --git a/pkgs/by-name/st/stardust-xr-magnetar/package.nix b/pkgs/by-name/st/stardust-xr-magnetar/package.nix deleted file mode 100644 index fbd3f5bee2df..000000000000 --- a/pkgs/by-name/st/stardust-xr-magnetar/package.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ - lib, - fetchFromGitHub, - rustPlatform, - nix-update-script, -}: - -rustPlatform.buildRustPackage { - pname = "stardust-xr-magnetar"; - version = "0-unstable-2025-04-03"; - - src = fetchFromGitHub { - owner = "stardustxr"; - repo = "magnetar"; - rev = "63ff648bb64c23023a0047ea3ff2c0b6b1fd3caf"; - hash = "sha256-LRI3HKuOUfUb93mHB8DUpp0hvES+GbzsKAxpkLCLzKQ="; - }; - - cargoHash = "sha256-ixzasTQDVVU8cGhSW3j8ELJmmYudwfnYQEIoULLQRyo="; - - passthru.updateScript = nix-update-script { - extraArgs = [ "--version=branch" ]; - }; - - meta = { - description = "Workspaces client for Stardust"; - homepage = "https://stardustxr.org"; - license = lib.licenses.mit; - mainProgram = "magnetar"; - maintainers = with lib.maintainers; [ - pandapip1 - technobaboo - ]; - platforms = lib.platforms.linux; - }; -} diff --git a/pkgs/by-name/st/stardust-xr-non-spatial-input/package.nix b/pkgs/by-name/st/stardust-xr-non-spatial-input/package.nix new file mode 100644 index 000000000000..dd5f43beeba9 --- /dev/null +++ b/pkgs/by-name/st/stardust-xr-non-spatial-input/package.nix @@ -0,0 +1,63 @@ +{ + lib, + fetchFromGitHub, + rustPlatform, + cmake, + libGL, + libinput, + libxkbcommon, + pkg-config, + udev, + wayland, + libx11, + libxcursor, + libxrandr, + libxi, + versionCheckHook, + nix-update-script, +}: + +rustPlatform.buildRustPackage (finalAttrs: { + pname = "stardust-xr-non-spatial-input"; + version = "0.51.1"; + + src = fetchFromGitHub { + owner = "stardustxr"; + repo = "non-spatial-input"; + tag = finalAttrs.version; + hash = "sha256-CWPEu+WvTtCo2zUXzyQkFcb5bFG9yVu/OnjPuoGKDGA="; + }; + + cargoHash = "sha256-QZaVDMeuxqHy9iQngb/wpv/P+KxevkoQqGojYIVzo2s="; + + __structuredAttrs = true; + strictDeps = true; + nativeBuildInputs = [ + cmake + pkg-config + ]; + buildInputs = [ + libGL + libinput + libxkbcommon + udev + wayland + libx11 + libxcursor + libxrandr + libxi + ]; + nativeCheckInputs = [ + versionCheckHook + ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Utilities that allow using non-spatial (e.g. keyboard and mouse) inputs in Stardust"; + homepage = "https://stardustxr.org"; + license = lib.licenses.mit; + teams = with lib.teams; [ stardust-xr ]; + platforms = lib.platforms.unix; + }; +}) diff --git a/pkgs/by-name/st/stardust-xr-phobetor/package.nix b/pkgs/by-name/st/stardust-xr-phobetor/package.nix deleted file mode 100644 index d590df979790..000000000000 --- a/pkgs/by-name/st/stardust-xr-phobetor/package.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ - lib, - fetchFromGitHub, - rustPlatform, - nix-update-script, -}: - -rustPlatform.buildRustPackage (finalAttrs: { - pname = "stardust-xr-phobetor"; - version = "0-unstable-2024-02-10"; - - src = fetchFromGitHub { - owner = "stardustxr"; - repo = "phobetor"; - rev = "f47d10c9ab8b37941bc9ca94677d6c80332376f3"; - hash = "sha256-7CWOoirQ/8zKCO7lBA9snyShlwsKYONiYkl39lQrpTY="; - }; - - env.STARDUST_RES_PREFIXES = "${finalAttrs.src}/res"; - - cargoHash = "sha256-H65uAHMAIkJ9D5q/5HxMEbvcfoRhYdFgTQejp6bvu5w="; - - passthru.updateScript = nix-update-script { - extraArgs = [ "--version=branch" ]; - }; - - meta = { - description = "Handheld panel shell for Stardust XR"; - homepage = "https://stardustxr.org"; - license = lib.licenses.mit; - mainProgram = "phobetor"; - maintainers = with lib.maintainers; [ - pandapip1 - technobaboo - ]; - platforms = lib.platforms.linux; - }; -}) diff --git a/pkgs/by-name/st/stardust-xr-protostar/package.nix b/pkgs/by-name/st/stardust-xr-protostar/package.nix index fab18684e814..b008528a2a2d 100644 --- a/pkgs/by-name/st/stardust-xr-protostar/package.nix +++ b/pkgs/by-name/st/stardust-xr-protostar/package.nix @@ -7,18 +7,21 @@ rustPlatform.buildRustPackage (finalAttrs: { pname = "stardust-xr-protostar"; - version = "0-unstable-2024-12-29"; + version = "0.51.1"; src = fetchFromGitHub { owner = "stardustxr"; repo = "protostar"; - rev = "9b73eb1e128b49a6d40a27a4cde7715d8cbd2674"; - hash = "sha256-9KJO1Z3Aq0+hh9QqufWBxpMmfFOmdgMUJxfgGZMg2n4="; + rev = finalAttrs.version; + hash = "sha256-mL7LnBvc2B9Y56NCDeNyqIDQsuWb4iMehZ7koR1KkX8="; }; env.STARDUST_RES_PREFIXES = "${finalAttrs.src}/res"; - cargoHash = "sha256-9XJ+nnvpTzr/3ii9dFkfZDex/++W5Mq9k0bh2Y6tueA="; + cargoHash = "sha256-6NiEKm6m4xX6ZSF9Gp7APG/lku3fKoobPSS4AodjCI8="; + + __structuredAttrs = true; + strictDeps = true; checkFlags = [ # ---- xdg::test_get_desktop_files stdout ---- @@ -39,18 +42,13 @@ rustPlatform.buildRustPackage (finalAttrs: { "--skip=xdg::test_render_svg_to_png" ]; - passthru.updateScript = nix-update-script { - extraArgs = [ "--version=branch" ]; - }; + passthru.updateScript = nix-update-script { }; meta = { description = "Prototype application launchers for Stardust XR"; homepage = "https://stardustxr.org"; license = lib.licenses.mit; - maintainers = with lib.maintainers; [ - pandapip1 - technobaboo - ]; - platforms = lib.platforms.linux; + teams = with lib.teams; [ stardust-xr ]; + platforms = lib.platforms.unix; }; }) diff --git a/pkgs/by-name/st/stardust-xr-server/fix-seat-unwrap-panic.patch b/pkgs/by-name/st/stardust-xr-server/fix-seat-unwrap-panic.patch new file mode 100644 index 000000000000..6655e059115e --- /dev/null +++ b/pkgs/by-name/st/stardust-xr-server/fix-seat-unwrap-panic.patch @@ -0,0 +1,58 @@ +diff --git a/src/wayland/xdg/backend.rs b/src/wayland/xdg/backend.rs +index e3860b8..9404a86 100644 +--- a/src/wayland/xdg/backend.rs ++++ b/src/wayland/xdg/backend.rs +@@ -29,9 +29,9 @@ pub struct XdgBackend { + } + + impl XdgBackend { +- pub fn new(seat: &Arc, toplevel: &Arc) -> Self { ++ pub fn new(seat: Weak, toplevel: &Arc) -> Self { + Self { +- seat: Arc::downgrade(seat), ++ seat, + toplevel: Arc::downgrade(toplevel), + children: DashMap::new(), + } +diff --git a/src/wayland/xdg/surface.rs b/src/wayland/xdg/surface.rs +index ddc3562..df733da 100644 +--- a/src/wayland/xdg/surface.rs ++++ b/src/wayland/xdg/surface.rs +@@ -74,7 +74,6 @@ impl XdgSurface for Surface { + + let toplevel_weak = Arc::downgrade(&toplevel); + let display = client.get::(ObjectId::DISPLAY).unwrap(); +- let seat = Arc::downgrade(display.seat.get().unwrap()); + let pid = display.pid; + let configured = self.configured.clone(); + let mut first_commit = true; +@@ -94,7 +93,8 @@ impl XdgSurface for Surface { + && configured.load(std::sync::atomic::Ordering::SeqCst) + && surface.currently_has_valid_buffer() + { +- let mapped_inner = MappedInner::create(&seat.upgrade().unwrap(), &toplevel, pid); ++ let seat = display.seat.get().map(Arc::downgrade).unwrap_or_default(); ++ let mapped_inner = MappedInner::create(seat, &toplevel, pid); + *surface.panel_item.lock() = Arc::downgrade(&mapped_inner.panel_item); + mapped_lock.replace(mapped_inner); + return false; +diff --git a/src/wayland/xdg/toplevel.rs b/src/wayland/xdg/toplevel.rs +index b10223e..a2e0f93 100644 +--- a/src/wayland/xdg/toplevel.rs ++++ b/src/wayland/xdg/toplevel.rs +@@ -13,6 +13,7 @@ use crate::{ + use mint::Vector2; + use parking_lot::Mutex; + use std::sync::Arc; ++use std::sync::Weak; + use waynest::ObjectId; + pub use waynest_protocols::server::stable::xdg_shell::xdg_toplevel::*; + use waynest_server::Client as _; +@@ -23,7 +24,7 @@ pub struct MappedInner { + pub panel_item: Arc>, + } + impl MappedInner { +- pub fn create(seat: &Arc, toplevel: &Arc, pid: Option) -> Self { ++ pub fn create(seat: Weak, toplevel: &Arc, pid: Option) -> Self { + let (panel_item_node, panel_item) = + PanelItem::create(Box::new(XdgBackend::new(seat, toplevel)), pid); diff --git a/pkgs/by-name/st/stardust-xr-server/package.nix b/pkgs/by-name/st/stardust-xr-server/package.nix index ea56ff8bd4cb..9c7f10c922ae 100644 --- a/pkgs/by-name/st/stardust-xr-server/package.nix +++ b/pkgs/by-name/st/stardust-xr-server/package.nix @@ -1,53 +1,71 @@ { lib, fetchFromGitHub, - nix-update-script, rustPlatform, - cmake, - cpm-cmake, - fontconfig, + alsa-lib, libGL, + libx11, + libxcursor, + libxcb, + libxi, libxkbcommon, - libgbm, openxr-loader, pkg-config, - libxfixes, - libx11, + vulkan-loader, + wayland, + nix-update-script, }: rustPlatform.buildRustPackage (finalAttrs: { pname = "stardust-xr-server"; - version = "0.44.1"; + version = "0.51.1"; src = fetchFromGitHub { owner = "stardustxr"; repo = "server"; tag = finalAttrs.version; - hash = "sha256-sCatpWDdy7NFWOWUARjN3fZMDVviX2iV79G0HTxfYZU="; + hash = "sha256-ntVc5fc1qMjR1FDqoNq35Y6PkG9VPNDVplyTpO6VhKA="; }; - cargoHash = "sha256-jCtMCZG3ku30tabTnVdGfgcLl5DoqhkJpLKPPliJgDU="; + patches = [ + # nixosTests/flatland hits a bug: + # it is permissible for a client to create an xdg_toplevel + # before binding wl_seat; weston-presentation-shm never + # binds a wl_seat since it doesn't need to accept input + # TODO(@Pandapip1): upstream + ./fix-seat-unwrap-panic.patch + ]; + cargoHash = "sha256-5HQkrkupBohmopGJh9t3JndVTU6cjbW0LgtBPb+YAr0="; + + __structuredAttrs = true; + strictDeps = true; nativeBuildInputs = [ - cmake pkg-config - rustPlatform.bindgenHook ]; - buildInputs = [ - fontconfig - libGL - libxkbcommon - libgbm - openxr-loader - libx11 - libxfixes + alsa-lib + wayland ]; - env.CPM_SOURCE_CACHE = "./build"; - - postPatch = '' - install -D ${cpm-cmake}/share/cpm/CPM.cmake $(echo $cargoDepsCopy/*/stereokit-sys-*/StereoKit)/build/cpm/CPM_0.32.2.cmake + postFixup = '' + patchelf $out/bin/stardust-xr-server --add-rpath ${ + lib.makeLibraryPath [ + # wgpu-hal hardcodes ash's runtime libvulkan dlopen() path (ash does expose an optional linked feature) + vulkan-loader + # Likewise, bevy_openxr doesn't use openxr's linked feature + openxr-loader + # x11-dl via winit x11 + libx11 + libxcursor + libxi + libxcb + # x11rb via winit and xkbcommon-dl + libxkbcommon + # wgpu-hal I think + libGL + ] + } ''; passthru.updateScript = nix-update-script { }; @@ -58,10 +76,7 @@ rustPlatform.buildRustPackage (finalAttrs: { changelog = "https://github.com/StardustXR/server/releases"; license = lib.licenses.gpl2Plus; mainProgram = "stardust-xr-server"; - maintainers = with lib.maintainers; [ - pandapip1 - technobaboo - ]; - platforms = lib.platforms.linux; + teams = with lib.teams; [ stardust-xr ]; + platforms = lib.platforms.unix; }; }) diff --git a/pkgs/by-name/st/stardust-xr-sphereland/package.nix b/pkgs/by-name/st/stardust-xr-sphereland/package.nix deleted file mode 100644 index efd80c02ea89..000000000000 --- a/pkgs/by-name/st/stardust-xr-sphereland/package.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ - lib, - fetchFromGitHub, - rustPlatform, - libxkbcommon, - nix-update-script, -}: - -rustPlatform.buildRustPackage (finalAttrs: { - pname = "stardust-xr-sphereland"; - version = "0-unstable-2023-11-07"; - - src = fetchFromGitHub { - owner = "stardustxr"; - repo = "sphereland"; - rev = "39552d918c99a84eaf5f2d5e8734a472bf196f65"; - hash = "sha256-LKdqTl14cdgD14IwAP34mWdDgREhy1CHOT86HywOxqM="; - }; - - env.STARDUST_RES_PREFIXES = "${finalAttrs.src}/res"; - - cargoHash = "sha256-4mESTxfogMQxfDMQRVML752fkinOIqkddW3PHmvxekc="; - - buildInputs = [ - libxkbcommon - ]; - - passthru.updateScript = nix-update-script { - extraArgs = [ "--version=branch" ]; - }; - - meta = { - description = "Pointer/keyboard operated window manager for Stardust XR"; - homepage = "https://stardustxr.org"; - license = lib.licenses.mit; - mainProgram = "sphereland"; - maintainers = with lib.maintainers; [ - pandapip1 - technobaboo - ]; - platforms = lib.platforms.linux; - }; -}) diff --git a/pkgs/by-name/wa/wayland-colorbar/package.nix b/pkgs/by-name/wa/wayland-colorbar/package.nix new file mode 100644 index 000000000000..96a17b666343 --- /dev/null +++ b/pkgs/by-name/wa/wayland-colorbar/package.nix @@ -0,0 +1,49 @@ +{ + lib, + stdenv, + fetchFromCodeberg, + cmake, + libffi, + pkg-config, + wayland, + wayland-protocols, + wayland-scanner, + nix-update-script, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "wayland-colorbar"; + version = "0.1.1"; + + src = fetchFromCodeberg { + owner = "Pandapip1"; + repo = "wayland-colorbar"; + tag = finalAttrs.version; + hash = "sha256-QaJWx5/DkxSc53BFufJwxYwwsJNSV2mYV5EjbFDmx3c="; + }; + + __structuredAttrs = true; + strictDeps = true; + separateDebugInfo = true; + nativeBuildInputs = [ + cmake + pkg-config + wayland-scanner + ]; + buildInputs = [ + libffi + wayland + wayland-protocols + ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "A simple wayland client that can be used for testing"; + homepage = "https://codeberg.org/Pandapip1/wayland-colorbar"; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ pandapip1 ]; + mainProgram = "wayland-colorbar"; + platforms = lib.platforms.unix; + }; +}) diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 9554fbc038a0..f64f2c5e6001 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -2006,6 +2006,10 @@ mapAliases { ssm-agent = throw "'ssm-agent' has been renamed to/replaced by 'amazon-ssm-agent'"; # Converted to throw 2025-10-27 stacer = throw "'stacer' has been removed because it was abandoned upstream and relied upon vulnerable software"; # Added 2025-11-08 stalwart-mail = warnAlias "'stalwart-mail' has been renamed to/replaced by 'stalwart'" stalwart; # Added 2026-01-19 + stardust-xr-kiara = throw "" "'stardust-xr-kiara' has been removed as it is no longer compatible with the latest versions of the Stardust XR server"; # Added 2026-07-04 + stardust-xr-magnetar = throw "" "'stardust-xr-magnetar' has been removed as it is no longer compatible with the latest versions of the Stardust XR server"; # Added 2026-07-04 + stardust-xr-phobetor = throw "" "'stardust-xr-phobetor' has been removed as it is no longer compatible with the latest versions of the Stardust XR server"; # Added 2026-07-04 + stardust-xr-sphereland = throw "" "'stardust-xr-sphereland' has been removed as it is no longer compatible with the latest versions of the Stardust XR server"; # Added 2026-07-04 starpls-bin = throw "'starpls-bin' has been renamed to/replaced by 'starpls'"; # Converted to throw 2025-10-27 station = throw "station has been removed from nixpkgs, as there were no committers among its maintainers to unblock security issues"; # Added 2025-06-16 steam-run-native = throw "'steam-run-native' has been renamed to/replaced by 'steam-run'"; # Converted to throw 2025-10-27