feat(tvix/boot): make VM cmdline and asserted VM output configurable

This can be used in the future to boot proper NixOS VMs, which want a
init= in their cmdline.

Change-Id: Iad4a25d5081f3a6af1c7f62f15853f3afaae4a0c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11190
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
This commit is contained in:
Florian Klink 2024-03-18 12:08:47 +02:00 committed by flokli
parent 898830b332
commit 8d177a18a5

View file

@ -18,6 +18,12 @@ let
, isClosure ? false
, importPathName ? null
# The cmdline to pass to the VM.
# Defaults to tvix.find, which lists all files in the store.
, vmCmdline ? "tvix.find"
# The string we expect to find in the VM output.
# Defaults the value of `path` (the store path we upload).
, assertVMOutput ? path
}:
assert isClosure -> importPathName == null;
@ -92,8 +98,8 @@ let
'' + ''
# Invoke a VM using tvix as the backing store, ensure the outpath appears in its listing.
CH_CMDLINE="tvix.find" run-tvix-vm 2>&1 | tee output.txt
grep ${path} output.txt
CH_CMDLINE="${vmCmdline}" run-tvix-vm 2>&1 | tee output.txt
grep "${assertVMOutput}" output.txt
'';
requiredSystemFeatures = [ "kvm" ];
};