anchor.diff:      # wait for socket
   
       waitForSSHD(){
  -      waitTill "waiting for socket in $TMP" '[ ! -e ./$SOCKET_NAME ]'
         waitTill "waiting for sshd job" "SSH 'echo Hello > /dev/tty1' &> /dev/null"
       }
   
  -
  +    nixBuildTest(){
  +    INFO "verifying that nix-env -i works"
  +
  +    SSH_STDIN_E << EOF
  +
  +      cat >> test.nix << EOF_TEST
  +      let pkgs = import /etc/nixos/nixpkgs/pkgs/top-level/all-packages.nix {};
  +      in pkgs.stdenv.mkDerivation {
  +        name = "test";
  +        phases = "create_out";
  +        create_out = "mkdir -p \\\$out/ok";
  +      }
  +    EOF_TEST
  +
  +      nix-build test.nix
  +      [ -e result/ok ]
  +    EOF
  +
  +    }
   
       ### test installting NixOS: install system then reboot
   
  
positive.code:     
      waitForSSHD
  
      # INSTALLATION
      INFO "creating filesystem .."
      SSH_STDIN_E << EOF
        set -x
        parted /dev/sda mklabel msdos
        parted /dev/sda mkpart primary 0 2G
        parted /dev/sda mkpart primary 1G 3G
  
negative.code:       # has the generated configuration.nix file syntax errors?
        nix-instantiate --eval-only /tmp/test.nix
  
        mkdir /mnt/root
        echo 'export NIXOS_CONFIG=/etc/nixos/nixos/tests/test-nixos-install-from-cd/configuration.nix' >> /mnt/root/.bashrc
        . /mnt/root/.bashrc
        export NIX_OTHER_STORES=/nix-on-host
  
        run-in-chroot "/nix/store/nixos-bootstrap --install --no-pull"
  