From d9c82ed3044c72cecf01c6ea042489d30914577c Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 1 Jul 2021 15:54:46 +0000 Subject: spectrumPackages.sys-vms.comp: switch to tinywl Recent versions of wlroots (not yet in Spectrum's Nixpkgs) make it impossible to use Wayfire as a Wayland client over Virtio Wayland, because of an architectural change in wlroots that means dma-bufs are now required to use the GLES2 renderer, which is the only one Wayfire supports, with the Wayland backend. Sommelier as a compositor does not (and cannot) support the zwp_linux_dmabuf_v1 Wayland protocol this requires, because to do so it would have to be able to send dma-bufs allocated by the guest client over Virtio Wayland. (This isn't possible because of general difficulties with guest->host memory sharing.) The "comp" VM as it stands is designed to be used with spectrum-vm, as a demo that people can run on their non-Spectrum systems, and see a Wayland compositor appear as a Wayland window in their host compositor. Since it's no longer possible to use Wayfire for this use case, let's use tinywl here instead, since we have no requirements that it doesn't fulfill as a minimum-viable compositor. This doesn't change anything regarding non-demo uses of Spectrum. Running a Wayland compositor itself as a Wayland client is not an activity that really makes sense in an actual Spectrum system. Realistic use cases for Wayland compositors in Spectrum (on a host system, or in a VM with a GPU passed through, or possibly in a VM with virtio-gpu) are not affected by this limitation, since in all cases the compositor would render directly to a GPU, not to a Wayland window to be displayed by another compositor. Message-Id: <20210701155446.1306212-3-hi@alyssa.is> --- .../os-specific/linux/spectrum/vm/comp/default.nix | 31 +++++++--------------- 1 file changed, 9 insertions(+), 22 deletions(-) (limited to 'pkgs/os-specific') diff --git a/pkgs/os-specific/linux/spectrum/vm/comp/default.nix b/pkgs/os-specific/linux/spectrum/vm/comp/default.nix index a2f068b5ec9..eb6317ed6f2 100644 --- a/pkgs/os-specific/linux/spectrum/vm/comp/default.nix +++ b/pkgs/os-specific/linux/spectrum/vm/comp/default.nix @@ -1,13 +1,13 @@ { lib, makeRootfs, runCommand, writeScript, writeText , busybox, emacs-nox, execline, gcc, linux_vm, s6, sommelier, source-code-pro -, wayfire, westonLite, zsh +, tinywl, westonLite, zsh }: runCommand "vm-comp" rec { linux = linux_vm; path = [ - busybox emacs-nox execline gcc s6 sommelier wayfire westonLite zsh + busybox emacs-nox execline gcc s6 sommelier tinywl westonLite zsh ]; login = writeScript "login" '' @@ -16,20 +16,6 @@ runCommand "vm-comp" rec { ${busybox}/bin/login -p -f root $@ ''; - # This can't be /etc/wayfire/defaults.ini because autostart entries - # from that file aren't applied. - wayfireConfig = writeText "wayfire-config" '' - [core] - xwayland = false - - [input] - xkb_layout = us - xkb_variant = dvorak - - [autostart] - terminal = weston-terminal --shell $(command -v zsh) - ''; - rootfs = makeRootfs { services.getty.run = writeScript "getty-run" '' #! ${execline}/bin/execlineb -P @@ -41,15 +27,15 @@ runCommand "vm-comp" rec { bundle ''; contents = writeText "ok-all-contents" '' - wayfire + compositor ''; }; - rcServices.wayfire = { - type = writeText "wayfire-type" '' + rcServices.compositor = { + type = writeText "compositor-type" '' longrun ''; - run = writeScript "wayfire-run" '' + run = writeScript "compositor-run" '' #! ${execline}/bin/execlineb -S0 s6-applyuidgid -u 1000 -g 1000 @@ -57,11 +43,12 @@ runCommand "vm-comp" rec { export HOME / export PATH ${lib.makeBinPath path} export XDG_RUNTIME_DIR /run/user/1000 + export XKB_DEFAULT_LAYOUT dvorak ${sommelier}/bin/sommelier - wayfire -c ${wayfireConfig} + ${tinywl}/bin/tinywl -s "weston-terminal --shell $(command -v zsh)" ''; - dependencies = writeText "wayfire-dependencies" '' + dependencies = writeText "compositor-dependencies" '' wl0 ''; }; -- cgit 1.4.1