0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

nixos/virtualisation: add option for explicitly named network interfaces

Adds a new option to the virtualisation modules that enables specifying
explicitly named network interfaces in QEMU VMs. The existing
`virtualisation.vlans` is still supported for cases where the name of
the network interface is irrelevant.
This commit is contained in:
Andrew Hoff 2023-01-07 15:43:15 -05:00
parent 1c18d9a5fb
commit 6ae3e7695e
6 changed files with 130 additions and 92 deletions

View file

@ -12,7 +12,9 @@ let
};
vlans = map (m: m.virtualisation.vlans) (lib.attrValues config.nodes);
vlans = map (m: (
m.virtualisation.vlans ++
(lib.mapAttrsToList (_: v: v.vlan) m.virtualisation.interfaces))) (lib.attrValues config.nodes);
vms = map (m: m.system.build.vm) (lib.attrValues config.nodes);
nodeHostNames =