nixos/tests/virtualbox: Generalize expression.

We're going to create more than one VirtualBox VM, so let's dynamically
generate subs specific to a particular VirtualBox VM, merging everything
into the testScript and machine expressions.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
nixos/virtualbox: Allow to disable hardening.

Hardening mode in VirtualBox is quite restrictive and on some systems it
could make sense to disable hardening mode, especially while we still
have issues with hostonly networking and other issues[TM] we don't know
or haven't tested yet.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
virtualbox package: Disable hardening by default.

Yes, this is only on the package level, so it's possible to use
VirtualBox for example installed by nix-env -i, which of course doesn't
have access to the functionality provided by the various VirtualBox
kernel modules.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
nixos/virtualbox: Note about "vboxusers" group.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
nixos/tests/virtualbox: Add test for hostonlyif.

Essentially adds two more VirtualBox VMs to the test and also increases
the memory size of the qemu VM to 768 MB to make sure we don't run out
of memory too soon.

We're testing whether those two VMs can talk to either each other
(currently via ICMP only) or to/from the host via TCP/IP.

Also, this restructures the VM test a bit, so that we now pass in a
custom stage2Init script that has access to the store via a private
mount over the /nix/store that's already in the initrd. The reason why
this is a private mount is that we don't want to shadow the Nix store of
the initrd, essentially breaking cleanup functionality after the custom
stage 2 script (currently this is only "poweroff -f").

Note that setting the hostname inside the VirtualBox VM is *not* for
additional fanciness but to produce a different store path for the VM
image, so that VirtualBox doesn't bail out when trying to use an image
which is already attached to another VM.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>