patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Alyssa Ross <hi@alyssa.is>
To: devel@spectrum-os.org
Subject: [PATCH v3 6/6] vm/app: add hello-wayland demo VM
Date: Fri, 21 Jul 2023 18:00:21 +0000	[thread overview]
Message-ID: <20230721180015.597099-7-hi@alyssa.is> (raw)
In-Reply-To: <20230721180015.597099-1-hi@alyssa.is>

From: Alyssa Ross <alyssa.ross@unikie.com>

hello-wayland is the simplest possible Wayland client.  This VM is
used to demonstrate Spectrum's new Wayland capabilities.

Signed-off-by: Alyssa Ross <alyssa.ross@unikie.com>
Signed-off-by: Alyssa Ross <hi@alyssa.is>
---
 host/initramfs/extfs.nix |  4 +++-
 vm/app/hello-wayland.nix | 29 +++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 vm/app/hello-wayland.nix

diff --git a/host/initramfs/extfs.nix b/host/initramfs/extfs.nix
index 6f32bca..174fc81 100644
--- a/host/initramfs/extfs.nix
+++ b/host/initramfs/extfs.nix
@@ -10,6 +10,7 @@ let
   };
 
   appvm-catgirl = import ../../vm/app/catgirl.nix { inherit config; };
+  appvm-hello-wayland = import ../../vm/app/hello-wayland.nix { inherit config; };
   appvm-lynx = import ../../vm/app/lynx.nix { inherit config; };
   appvm-mg = import ../../vm/app/mg.nix { inherit config; };
 in
@@ -17,13 +18,14 @@ in
 runCommand "ext.ext4" {
   nativeBuildInputs = [ e2fsprogs ];
 } ''
-  mkdir -p root/svc/data/appvm-{catgirl,lynx,mg}
+  mkdir -p root/svc/data/appvm-{catgirl,hello-wayland,lynx,mg}
   cd root
 
   tar -C ${netvm} -c data | tar -C svc -x
   chmod +w svc/data
 
   tar -C ${appvm-catgirl} -c . | tar -C svc/data/appvm-catgirl -x
+  tar -C ${appvm-hello-wayland} -c . | tar -C svc/data/appvm-hello-wayland -x
   tar -C ${appvm-lynx} -c . | tar -C svc/data/appvm-lynx -x
   tar -C ${appvm-mg} -c . | tar -C svc/data/appvm-mg -x
 
diff --git a/vm/app/hello-wayland.nix b/vm/app/hello-wayland.nix
new file mode 100644
index 0000000..e10f05e
--- /dev/null
+++ b/vm/app/hello-wayland.nix
@@ -0,0 +1,29 @@
+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2022 Unikie
+# SPDX-FileCopyrightText: 2023 Alyssa Ross <hi@alyssa.is>
+
+import ../../lib/eval-config.nix ({ config, ... }:
+
+import ../make-vm.nix { inherit config; } {
+  wayland = true;
+  run = config.pkgs.pkgsStatic.callPackage (
+    { writeScript, hello-wayland }:
+    writeScript "run-hello-wayland" ''
+      #!/bin/execlineb -P
+      foreground { ln -ns /run/ext /run/opengl-driver }
+      foreground { mkdir /run/user }
+      foreground {
+        umask 077
+        mkdir /run/user/0
+      }
+      if { /etc/mdev/wait card0 }
+      export XDG_RUNTIME_DIR /run/user/0
+
+      # No pkgsStatic.wayland-proxy-virtwl:
+      # https://github.com/nix-ocaml/nix-overlays/issues/698
+      ${config.pkgs.pkgsMusl.wayland-proxy-virtwl}/bin/wayland-proxy-virtwl --virtio-gpu
+
+      ${hello-wayland}/bin/hello-wayland
+    ''
+  ) { };
+})
-- 
2.40.1



  parent reply	other threads:[~2023-07-21 18:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-21 18:00 [PATCH v3 0/6] Initial support for VM Wayland Alyssa Ross
2023-07-21 18:00 ` [PATCH v3 1/6] img/app: allow waiting for GPU to appear Alyssa Ross
2023-07-28 12:10   ` Alyssa Ross
2023-07-21 18:00 ` [PATCH v3 2/6] vm-lib: add mesa drivers to VM Alyssa Ross
2023-07-28 12:10   ` Alyssa Ross
2023-07-21 18:00 ` [PATCH v3 3/6] img/app: add support for testing virtio-gpu Alyssa Ross
2023-07-28 12:10   ` Alyssa Ross
2023-07-21 18:00 ` [PATCH v3 4/6] vm: add support for testing in crosvm Alyssa Ross
2023-07-28 12:10   ` Alyssa Ross
2023-07-21 18:00 ` [PATCH v3 5/6] host: add support for Wayland in VMs Alyssa Ross
2023-07-28 12:10   ` Alyssa Ross
2023-07-21 18:00 ` Alyssa Ross [this message]
2023-07-28 12:10   ` [PATCH v3 6/6] vm/app: add hello-wayland demo VM Alyssa Ross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230721180015.597099-7-hi@alyssa.is \
    --to=hi@alyssa.is \
    --cc=devel@spectrum-os.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).