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:
parent
4be1089781
commit
9fa2c35ec8
@ -9,6 +9,11 @@ in
|
|||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
services.virtualboxHost.enable = mkEnableOption "VirtualBox Host support";
|
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 {
|
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.
|
# Since we lack the right setuid binaries, set up a host-only network by default.
|
||||||
|
} // mkIf config.services.virtualboxHost.addNetworkInterface {
|
||||||
systemd.services."vboxnet0" =
|
systemd.services."vboxnet0" =
|
||||||
{ description = "VirtualBox vboxnet0 Interface";
|
{ description = "VirtualBox vboxnet0 Interface";
|
||||||
requires = [ "dev-vboxnetctl.device" ];
|
requires = [ "dev-vboxnetctl.device" ];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user