runNixosTest with a different base iso

I wasn’t really able to find information about this online, and I’m not yet too familiar with the NixosTest implementation. So, asking here. :grin:

Would it be possible to have a runNixosTest that does not use NixOS as the OS?
E.g. I’d like to run tests on a macOS machine that don’t really depend on a NixOS module, but could benefit from the framework. I enjoy the way how you can write a small Python script to run the tests, and I’d like to emulate this for different OS’s as well.

Furthermore, I’d image it’d look something like this:

let
  nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.05";
  pkgs = import nixpkgs { config = {}; overlays = []; };
in

pkgs.testers.runNixOSTest {
  name = "macos-vm-test";
  nodes = {
    some-macos-vm = { config, pkgs, ... }: {
      image = someDerivationThatOutputsAmacosVM;
    };
    some-linux-vm = { config, pkgs, ... }: {
      image = someSpecificLinuxDistro;
    };
  };
  testScript = { nodes, ... }: ''
    # ...
  '';
}

Where I can have a network of VMs under test, but they don’t all have to be a NixOS machine.

That is not currently supported.

Check out GitHub - numtide/nix-vm-test: Re-use the NixOS VM test infrastructure to test Ubuntu, Debian, and Fedora machines. where we implemented something like this.
You’ll probably still need to tweak some things to get a heterogeneous network of VMs though.