git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit9fa2c35ec8199951f217296e40f534c1e2e0f336 authorambrop7@gmail.com <Ambroz Bizjak> dateThu 11 Dec 2014, 23:28 (12 years ago) parent4be1089
1 file changed+6−1
nixos/modules/programs/virtualbox-host.nix+6−1
nixos/modules/programs/virtualbox-host.nix+6−1
@@ -9,6 +9,11 @@ in
99{
1010 options = {
1111 services.virtualboxHost.enable = mkEnableOption "VirtualBox Host support";
12+ services.virtualboxHost.addNetworkInterface = mkOption {
13+ type = types.bool;
14+ default = true;
15+ description = "Automatically set up a vboxnet0 host-only network interface.";
16+ };
1217 };
1318
1419 config = mkIf config.services.virtualboxHost.enable {
@@ -46,7 +51,7 @@ in
4651 '';
4752
4853 # Since we lack the right setuid binaries, set up a host-only network by default.
49−
54+ } // mkIf config.services.virtualboxHost.addNetworkInterface {
5055 systemd.services."vboxnet0" =
5156 { description = "VirtualBox vboxnet0 Interface";
5257 requires = [ "dev-vboxnetctl.device" ];