summary refs log tree commit diff
path: root/nixos/lib/build-vms.nix
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2021-10-17 23:56:52 +0200
committerRobert Hensing <robert@roberthensing.nl>2021-10-17 23:56:52 +0200
commitc24782765413fceb7aad9c004a9b1ba19da9c573 (patch)
tree486d9e1d7fdf7e98d56f56c6731e9e9f239d4215 /nixos/lib/build-vms.nix
parentc7fd252d324f6eb4eeb9a769d1533cb4ede361ad (diff)
downloadnixpkgs-c24782765413fceb7aad9c004a9b1ba19da9c573.tar
nixpkgs-c24782765413fceb7aad9c004a9b1ba19da9c573.tar.gz
nixpkgs-c24782765413fceb7aad9c004a9b1ba19da9c573.tar.bz2
nixpkgs-c24782765413fceb7aad9c004a9b1ba19da9c573.tar.lz
nixpkgs-c24782765413fceb7aad9c004a9b1ba19da9c573.tar.xz
nixpkgs-c24782765413fceb7aad9c004a9b1ba19da9c573.tar.zst
nixpkgs-c24782765413fceb7aad9c004a9b1ba19da9c573.zip
nixosTest: Provide system.build.networkConfig
Diffstat (limited to 'nixos/lib/build-vms.nix')
-rw-r--r--nixos/lib/build-vms.nix15
1 files changed, 11 insertions, 4 deletions
diff --git a/nixos/lib/build-vms.nix b/nixos/lib/build-vms.nix
index 0f0bdb4a86c..05d9ce89dbd 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)
         ] );