anchor.diff:  
           trap cleanup SIGTERM SIGKILL EXIT
   
  -        uuid="$(uuidgen -r)"
  +        # Variables that are substituted within the libvirt XML files
  +        testid="$(basename "$out")"
  +        testid="''${testid%%-*}"
           pwd="$(pwd)"
  -
  -        ${optionalString (cfg.backend == "lxc") ''
  -          mkdir root-{${concatMapStringsSep "," (n: ''"${n}"'') (attrNames cfg.instances)}}
  -          uid="$(id -u)"
  -          gid="$(id -g)"
  -        ''}
  -
  -        echo "Test UUID: $uuid"
  -
  -        mkdir -p out/logs out/libvirt
  -        touch out/logs/{${concatMapStringsSep "," (n: ''"${n}"'')
  -          (attrNames cfg.instances)}}.{console,journal}
  +        uid="$(id -u)"
  +        gid="$(id -g)"
  +
  +        # Setup directories and libvirt XML files
  +        mkdir -p out/libvirt out/hosts/{${instList}}
  +        touch out/hosts/{${instList}}/{console,journal}.log
           cp -t out/libvirt "$src"/*
  -
           for f in out/libvirt/{dom,net}-*.xml; do substituteAllInPlace "$f"; done
  +        ${optionalString (cfg.backend == "lxc") "mkdir root-{${instList}}"}
   
           # Let libvirt access paths inside the build directory and write to out dir
           chmod a+x .
  -        chmod a+w out
  -
  -        tail -Fq out/stdout.log out/stderr.log \
  -          ${concatMapStringsSep " " (n: "out/logs/${n}.journal")
  -            (attrNames cfg.instances)
  -          } 2>/dev/null &
  -
  -        # Start libvirt machines
  -        virsh -c "${cfg.connectionURI}" "${virshCmds}" >/dev/null || true
  -
  -        test -a out/done || echo >&2 "Possible test timeout!"
  -        test -a out/passed || exit 1
  -
  -        chmod go-w out
  -        mv out $out
  +        chmod a+w out/hosts/*
  +
  +        tail -Fq out/hosts/test-driver/script.std{out,err} \
  +          out/hosts/{${instList}}/{console,journal}.log 2>/dev/null &
  +
  +        ${pkgs.libvirt}/bin/virsh -c "${cfg.connectionURI}" \
  +          "${virshCmds}" >/dev/null || true
  +
  +        cleanup
         '';
  +
  +      installPhase = "mv out $out";
       };
   
     };
  
positive.code:         default = 600;
        };
  
        out.result = mkOption {
          type = types.path;
        };
  
        backend = mkOption {
  
negative.code:   config = {
  
      libvirt.test.instances.test-driver = {
        libvirt.name = mkForce "@testid@";
        nixos.modules = cfg.test-driver.extraModules ++ [{
          systemd.services.test-script = {
            wantedBy = [ "multi-user.target" ];
            wants = [ "network.target" ];
            after = [ "network.target" ];
  