diff options
Diffstat (limited to 'vm-lib/make-vm.nix')
-rw-r--r-- | vm-lib/make-vm.nix | 9 |
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" '' |