From cc0fb9637eaaea395e148b6c67c1098e0dfc2ae6 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Thu, 17 Jun 2021 19:05:24 +0200 Subject: [PATCH] testing: some usability improvements --- testing.nix | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/testing.nix b/testing.nix index 4d31085..978bec8 100644 --- a/testing.nix +++ b/testing.nix @@ -1,4 +1,4 @@ -{ lib, ... }: +{ pkgs, lib, ... }: let secrets = toString ./secrets; @@ -11,24 +11,23 @@ in ]; virtualisation.memorySize = "4000"; # MB + virtualisation.graphics = false; - virtualisation.qemu.options = [ - # Use serial console to access the VM - "-display none" - "-serial mon:stdio" + virtualisation.qemu.options = + [ # Ensure secrets are accessible by the + # activation scripts at runtime. + "-virtfs local,path=${secrets},security_model=none,mount_tag=secrets" + ]; - # Ensure secrets are accessible by the - # activation scripts at runtime. - "-virtfs local,path=${secrets},security_model=none,mount_tag=secrets" - ]; + virtualisation.fileSystems."${secrets}" = + { device = "secrets"; + fsType = "9p"; + options = [ "trans=virtio" "version=9p2000.L" ]; + neededForBoot = true; + }; - fileSystems = lib.mkVMOverride { - "${secrets}" = - { device = "secrets"; - fsType = "9p"; - options = [ "trans=virtio" "version=9p2000.L" ]; - neededForBoot = true; - }; - }; + # Automatically resize the console + environment.systemPackages = [ pkgs.xterm ]; + environment.shellInit = "resize > /dev/null"; }