git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/virtualbox/hostonlyif: Fix writing to /root.

Creates unnecessary cruft in the root users home directory, which we really don't need. Except the log, but therefore we now cat the log to stderr and the private temporary directory is cleaned up afterwards. Signed-off-by: aszlig <aszlig@redmoonstudios.org>

commitd85fabd68cb0477f7bda4af8a528e27ed7914932 authoraszlig <aszlig@redmoonstudios.org> dateMon 15 Dec 2014, 19:12 (12 years ago) parent5d67b17
2 files changed+4
nixos/modules/programs/virtualbox-host.nix+3 nixos/tests/virtualbox.nix+1
nixos/modules/programs/virtualbox-host.nix+3
@@ -97,10 +97,13 @@ in
9797 path = [ virtualbox ];
9898 serviceConfig.RemainAfterExit = true;
9999 serviceConfig.Type = "oneshot";
100+ serviceConfig.PrivateTmp = true;
101+ environment.VBOX_USER_HOME = "/tmp";
100102 script =
101103 ''
102104 if ! [ -e /sys/class/net/vboxnet0 ]; then
103105 VBoxManage hostonlyif create
106+ cat /tmp/VBoxSVC.log >&2
104107 fi
105108 '';
106109 postStop =
nixos/tests/virtualbox.nix+1
@@ -348,6 +348,7 @@ in {
348348
349349 subtest "privilege-escalation", sub {
350350 $machine->fail("test -e '/root/VirtualBox VMs'");
351+ $machine->fail("test -e '/root/.config/VirtualBox'");
351352 $machine->succeed("test -e '/home/alice/VirtualBox VMs'");
352353 };
353354