virtualbox: Explicitly excempt src during install.

Instead of coping it to $out and later deleting it, we now exclude the
src directory during copy. Also, we no longer cd into the release
directory during installPhase, which should make sure that we are
constantly in $sourceRoot.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
(cherry picked from commit 5a8c5d27681215f5f3cdd41d9c002799bf3b94ca)
virtualbox: Fix hardcoded /sbin/ifconfig path.

Just accidentally found this while debugging and it's needed for
fetching a few interface details, not sure however whether because of
this anything has been broken so far.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
(cherry picked from commit 14ef3446e163b3afecf7d676282cc496ec7c430d)
virtualbox: Allow to easily change the build type.

Not really changes anything in functionality, but makes it easier to
change the build type to "debug", for example.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
(cherry picked from commit b69ac6c15955ef5115360baf6f7ec361a9037d49)
virtualbox: Fix runtime paths in hardening mode.

Because we have to rely on setuid wrappers on NixOS, we can't easily
hardcode the executable paths and set it 4755. So for all calls, we need
to change the runtime path executable directory to /var/setuid-wrappers/
and for verification we need to retain the executable directory.

Also note, that usually VBoxNetAdpCtl, VBoxNetDHCP, VBoxNetNAT, VBoxSDL
and VBoxVolInfo don't reside in directories that are commonly in PATH,
but in /usr/lib/virtualbox in most mainstream distros. But because the
names of these executables are distinctive enough to not cause
collisions with other setuid programs, I'll leave it like that and not
patch up setuid-wrappers.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
(cherry picked from commit ac603e208c98b260db675fa0c13be94fa95216f4)
nixos/tests/virtualbox: Don't use vboxusers group.

At least when we're running in hardening mode, because it's needed there
only for USB support.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
(cherry picked from commit ef691d5c304187bb99526c2e3478540e5d355f66)
nixos/tests/virtualbox: Disable debug logging.

Especially if the user isn't in the vboxusers group anymore, this gets
VERY noisy, because the VBoxSVC process emits warnings for every single
USB device noting that it's only possible to access it when the user is
in the vboxusers group.

So, we now have a debug attribute, where we can enable it when
necessary.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
(cherry picked from commit d45649b415be05ff7abd250ff5148c792660df60)
nixos/virtualbox: Revert disable hardening.

This reverts commit 5d67b17901ff2c9a18647bd9453c6b0d4294b875.

The issues have been resolved by ac603e208c98b260db675fa0c13be94fa95216f4.

Tested this with hostonlyifs and USB support with extension pack.

Conflicts:
	nixos/modules/programs/virtualbox-host.nix

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Tested-by: Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>
Tested-by: tv <tv@shackspace.de>
Tested-by: Domen Kožar <domen@dev.si>
(cherry picked from commit f7384b8c75a17689aca3a53617b937e1bf67b417)