{ nixpkgs ? import { }, }: let nixpkgs-testContainers = nixpkgs.fetchFromGitHub { owner = "applicative-systems"; repo = "nixpkgs"; rev = "nixos-test-containers"; hash = nixpkgs.lib.fakeHash; }; pkgs = import nixpkgs-testContainers { overlays = [ ]; config = { }; }; inherit (pkgs) lib; numberOfMachines = 24; helloMachine = { pkgs, ... }: { environment.systemPackages = [ pkgs.hello ]; }; in { hello-qemu = pkgs.testers.runNixOSTest { name = "hello-qemu"; skipLint = true; skipTypeCheck = true; nodes = lib.genAttrs' (lib.range 0 (numberOfMachines - 1)) (x: { name = "vm${toString x}"; value = helloMachine; }); testScript = { nodes, ... }: '' start_all() ${lib.concatMapStringsSep "\n" (node: '' ${node}.succeed("hello") '') (lib.attrNames nodes)} ''; }; hello-nspawn = pkgs.testers.runNixOSTest { name = "hello-nspawn"; skipLint = true; skipTypeCheck = true; containers = lib.genAttrs' (lib.range 0 (numberOfMachines - 1)) (x: { name = "c${toString x}"; value = helloMachine; }); testScript = { containers, ... }: '' start_all() ${lib.concatMapStringsSep "\n" (container: '' ${container}.succeed("hello") '') (lib.attrNames containers)} ''; }; }