@@ -9,6 +9,11 @@ in
10 options = {
10 options = {
11 services.virtualboxHost.enable = mkEnableOption "VirtualBox Host support";
11 services.virtualboxHost.enable = mkEnableOption "VirtualBox Host support";
12+ services.virtualboxHost.addNetworkInterface = mkOption {
15+ description = "Automatically set up a vboxnet0 host-only network interface.";
14 config = mkIf config.services.virtualboxHost.enable {
19 config = mkIf config.services.virtualboxHost.enable {
@@ -46,7 +51,7 @@ in
48 # Since we lack the right setuid binaries, set up a host-only network by default.
53 # Since we lack the right setuid binaries, set up a host-only network by default.
49−
54+ } // mkIf config.services.virtualboxHost.addNetworkInterface {
50 systemd.services."vboxnet0" =
55 systemd.services."vboxnet0" =
51 { description = "VirtualBox vboxnet0 Interface";
56 { description = "VirtualBox vboxnet0 Interface";
52 requires = [ "dev-vboxnetctl.device" ];
57 requires = [ "dev-vboxnetctl.device" ];