···11+{ testName }:
22+let
33+ # Use the flake-compat code in project root to access the tests which are
44+ # defined through Flakes, as flake-parts is heavily depended on here.
55+ flake = import ../../../.;
66+in
77+{
88+99+ # This is glue for the newly deployed VMs as they need specific configuration
1010+ # such as static network configuration and other nitpicky VM-specific options.
1111+ # I thank Colmena & NixOps devs for providing me pointers on how to correctly create this, so
1212+ # thank you to those who made them!
1313+ #
1414+ mkHiveNode =
1515+ {
1616+ hostname,
1717+ system ? "x86_64-linux",
1818+ }:
1919+ cfg: {
2020+ imports = [
2121+ cfg
2222+ (
2323+ {
2424+ modulesPath,
2525+ ...
2626+ }:
2727+ {
2828+ imports = [
2929+ "${modulesPath}/virtualisation/qemu-vm.nix"
3030+ "${modulesPath}/testing/test-instrumentation.nix"
3131+ flake.checks.${system}."nixos-vm-test-${testName}".nodes.${hostname}.system.build.networkConfig
3232+ ];
3333+3434+ nixpkgs.hostPlatform = system;
3535+ boot.loader.grub.enable = false;
3636+ }
3737+ )
3838+ ];
3939+ };
4040+4141+ __functor = self: self.mkHiveNode;
4242+}