summary refs log tree commit diff
path: root/vm-lib/make-vm.nix
diff options
context:
space:
mode:
authorAlyssa Ross <alyssa.ross@unikie.com>2023-07-21 18:00:19 +0000
committerAlyssa Ross <hi@alyssa.is>2023-07-28 12:09:17 +0000
commited8271dc5db12278b71e071dee1b8153af1d36e0 (patch)
tree091578eee0a23ce0145e6bae00a07de3c174a078 /vm-lib/make-vm.nix
parent76b6acdb22a49e296fda9626398414839c01efbe (diff)
downloadspectrum-ed8271dc5db12278b71e071dee1b8153af1d36e0.tar
spectrum-ed8271dc5db12278b71e071dee1b8153af1d36e0.tar.gz
spectrum-ed8271dc5db12278b71e071dee1b8153af1d36e0.tar.bz2
spectrum-ed8271dc5db12278b71e071dee1b8153af1d36e0.tar.lz
spectrum-ed8271dc5db12278b71e071dee1b8153af1d36e0.tar.xz
spectrum-ed8271dc5db12278b71e071dee1b8153af1d36e0.tar.zst
spectrum-ed8271dc5db12278b71e071dee1b8153af1d36e0.zip
host: add support for Wayland in VMs
When a VM is configured with Wayland support, the ext-rc-init service
will create an additional service to supervise the crosvm GPU backend,
and start-vm will pass the required arguments to cloud-hypervisor to
tell it how to connect to crosvm.

Signed-off-by: Alyssa Ross <alyssa.ross@unikie.com>
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Message-Id: <20230721180015.597099-6-hi@alyssa.is>
Diffstat (limited to 'vm-lib/make-vm.nix')
-rw-r--r--vm-lib/make-vm.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/vm-lib/make-vm.nix b/vm-lib/make-vm.nix
index 80e6ef5..c3533ec 100644
--- a/vm-lib/make-vm.nix
+++ b/vm-lib/make-vm.nix
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: MIT
 # SPDX-FileCopyrightText: 2022 Alyssa Ross <hi@alyssa.is>
+# SPDX-FileCopyrightText: 2022 Unikie
 
 { pkgs ? import <nixpkgs> {}
 
@@ -13,7 +14,7 @@ pkgs.pkgsStatic.callPackage (
 
 { lib, runCommand, writeReferencesToFile, erofs-utils }:
 
-{ run, providers ? {}, sharedDirs ? {} }:
+{ run, providers ? {}, sharedDirs ? {}, wayland ? false }:
 
 let
   inherit (lib)
@@ -26,6 +27,8 @@ assert !(any (hasInfix "\n") (concatLists (attrValues providers)));
 runCommand "spectrum-vm" {
   nativeBuildInputs = [ erofs-utils ];
 
+  inherit wayland;
+
   providerDirs = concatStrings (concatLists
     (mapAttrsToList (kind: map (vm: "${kind}/${vm}\n")) providers));
   passAsFile = [ "providerDirs" ];
@@ -53,6 +56,10 @@ runCommand "spectrum-vm" {
 
   popd
 
+  if [ -n "$wayland" ]; then
+      touch "$out/wayland"
+  fi
+
   ln -s /usr/img/appvm/blk/root.img "$out/blk"
   ln -s /usr/img/appvm/vmlinux "$out"
 ''