mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 13:40:28 +03:00
Merge pull request #178290 from andrew-hoff/ahh/qemu-interfaces
nixos/virtualisation: add option for explicitly named network interfaces
This commit is contained in:
commit
8803f1da66
6 changed files with 130 additions and 92 deletions
|
@ -545,7 +545,8 @@ in
|
|||
virtualisation.vlans =
|
||||
mkOption {
|
||||
type = types.listOf types.ints.unsigned;
|
||||
default = [ 1 ];
|
||||
default = if config.virtualisation.interfaces == {} then [ 1 ] else [ ];
|
||||
defaultText = lib.literalExpression ''if config.virtualisation.interfaces == {} then [ 1 ] else [ ]'';
|
||||
example = [ 1 2 ];
|
||||
description =
|
||||
lib.mdDoc ''
|
||||
|
@ -560,6 +561,35 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
virtualisation.interfaces = mkOption {
|
||||
default = {};
|
||||
example = {
|
||||
enp1s0.vlan = 1;
|
||||
};
|
||||
description = lib.mdDoc ''
|
||||
Network interfaces to add to the VM.
|
||||
'';
|
||||
type = with types; attrsOf (submodule {
|
||||
options = {
|
||||
vlan = mkOption {
|
||||
type = types.ints.unsigned;
|
||||
description = lib.mdDoc ''
|
||||
VLAN to which the network interface is connected.
|
||||
'';
|
||||
};
|
||||
|
||||
assignIP = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = lib.mdDoc ''
|
||||
Automatically assign an IP address to the network interface using the same scheme as
|
||||
virtualisation.vlans.
|
||||
'';
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
virtualisation.writableStore =
|
||||
mkOption {
|
||||
type = types.bool;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue