diff options
author | Robert Hensing <robert@roberthensing.nl> | 2021-10-17 23:56:52 +0200 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2021-10-17 23:56:52 +0200 |
commit | c24782765413fceb7aad9c004a9b1ba19da9c573 (patch) | |
tree | 486d9e1d7fdf7e98d56f56c6731e9e9f239d4215 /nixos/lib/build-vms.nix | |
parent | c7fd252d324f6eb4eeb9a769d1533cb4ede361ad (diff) | |
download | nixlib-c24782765413fceb7aad9c004a9b1ba19da9c573.tar nixlib-c24782765413fceb7aad9c004a9b1ba19da9c573.tar.gz nixlib-c24782765413fceb7aad9c004a9b1ba19da9c573.tar.bz2 nixlib-c24782765413fceb7aad9c004a9b1ba19da9c573.tar.lz nixlib-c24782765413fceb7aad9c004a9b1ba19da9c573.tar.xz nixlib-c24782765413fceb7aad9c004a9b1ba19da9c573.tar.zst nixlib-c24782765413fceb7aad9c004a9b1ba19da9c573.zip |
nixosTest: Provide system.build.networkConfig
Diffstat (limited to 'nixos/lib/build-vms.nix')
-rw-r--r-- | nixos/lib/build-vms.nix | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/nixos/lib/build-vms.nix b/nixos/lib/build-vms.nix index 0f0bdb4a86cb..05d9ce89dbdc 100644 --- a/nixos/lib/build-vms.nix +++ b/nixos/lib/build-vms.nix @@ -68,9 +68,8 @@ rec { prefixLength = 24; } ]; }); - in - { key = "ip-address"; - config = + + networkConfig = { networking.hostName = mkDefault m.fst; networking.interfaces = listToAttrs interfaces; @@ -96,7 +95,15 @@ rec { in flip concatMap interfacesNumbered ({ fst, snd }: qemu-common.qemuNICFlags snd fst m.snd); }; - } + + in + { key = "ip-address"; + config = networkConfig // { + # Expose the networkConfig items for tests like nixops + # that need to recreate the network config. + system.build.networkConfig = networkConfig; + }; + } ) (getAttr m.fst nodes) ] ); |