3
0
Fork 0
forked from mirrors/nixpkgs

virtualbox: Allow disabling the network interface.

The current nixos module for VirtualBox unconditionally configures a vboxnet0
network interface at boot. This may be undesired, especially when the user wants
to manage network interfaces in a centralized manner.
This commit is contained in:
ambrop7@gmail.com 2014-12-11 23:28:09 +01:00
parent 4be1089781
commit 9fa2c35ec8

View file

@ -9,6 +9,11 @@ in
{
options = {
services.virtualboxHost.enable = mkEnableOption "VirtualBox Host support";
services.virtualboxHost.addNetworkInterface = mkOption {
type = types.bool;
default = true;
description = "Automatically set up a vboxnet0 host-only network interface.";
};
};
config = mkIf config.services.virtualboxHost.enable {
@ -46,7 +51,7 @@ in
'';
# Since we lack the right setuid binaries, set up a host-only network by default.
} // mkIf config.services.virtualboxHost.addNetworkInterface {
systemd.services."vboxnet0" =
{ description = "VirtualBox vboxnet0 Interface";
requires = [ "dev-vboxnetctl.device" ];