diff options
Diffstat (limited to 'tvix/boot/default.nix')
-rw-r--r-- | tvix/boot/default.nix | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/tvix/boot/default.nix b/tvix/boot/default.nix index 0f2edc30855b..60eb2f1b7608 100644 --- a/tvix/boot/default.nix +++ b/tvix/boot/default.nix @@ -1,13 +1,16 @@ -{ depot, pkgs, ... }: +{ lib, pkgs, ... }: rec { # A binary that sets up /nix/store from virtiofs, lists all store paths, and # powers off the machine. - tvix-init = depot.nix.buildGo.program { + tvix-init = pkgs.buildGoModule rec { name = "tvix-init"; - srcs = [ - ./tvix-init.go - ]; + src = lib.fileset.toSource { + root = ./.; + fileset = ./tvix-init.go; + }; + vendorHash = null; + postPatch = "go mod init ${name}"; }; # A kernel with virtiofs support baked in @@ -67,7 +70,7 @@ rec { # Start a `tvix-store` virtiofs daemon from $PATH, then a cloud-hypervisor # pointed to it. # Supports the following env vars (and defaults) - # CH_NUM_CPUS=1 + # CH_NUM_CPUS=2 # CH_MEM_SIZE=512M # CH_CMDLINE="" runVM = pkgs.writers.writeBashBin "run-tvix-vm" '' @@ -89,7 +92,7 @@ rec { # Wait for the socket to exist. until [ -e $tempdir/tvix.sock ]; do sleep 0.1; done - CH_NUM_CPUS="''${CH_NUM_CPUS:-1}" + CH_NUM_CPUS="''${CH_NUM_CPUS:-2}" CH_MEM_SIZE="''${CH_MEM_SIZE:-512M}" CH_CMDLINE="''${CH_CMDLINE:-}" @@ -99,10 +102,10 @@ rec { --memory mergeable=on,shared=on,size=$CH_MEM_SIZE \ --console null \ --serial tty \ - --kernel ${kernel.dev}/vmlinux \ + --kernel ${kernel}/${pkgs.stdenv.hostPlatform.linux-kernel.target} \ --initramfs ${initrd} \ --cmdline "console=ttyS0 $CH_CMDLINE" \ - --fs tag=tvix,socket=$tempdir/tvix.sock,num_queues=1,queue_size=512 + --fs tag=tvix,socket=$tempdir/tvix.sock,num_queues=''${CH_NUM_CPU},queue_size=512 ''; meta.ci.targets = [ |