anchor.diff:      INFO "booting installed system"
       RUN_KVM -boot c
       waitForSSHD
  +
  +
  +    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
  +
  +      set -x
  +      nix-env -i -f test.nix
  +      [ -e ~/.nix-profile/ok ]
  +    EOF
  +
       SHUTDOWN_VM
   
       echo "$(date) success" > $out
  
positive.code: 
      # TODO add nix-env -i command and verify that root can install additional
      # tools such as git or sshfs-fuse!
      # run this test when booting both: the iso and the installed system
      pkgs.runCommand "nixos-installation-test" { inherit systemDerivation; } ''
  
      INFO(){ echo "INFO: " $@; }
  
negative.code:     # creating shell script for debugging purposes
      cat >> run-kvm.sh << EOF
      #!/bin/sh -e
  
      # don't ask me why I have to remove the socket.. If I don't it won't be
      # reused by kvm_qemu!
      rm $SOCKET_NAME || true
      exec qemu-system-x86_64 -m 512 \
          -no-kvm-irqchip \
          -net nic,model=virtio -net user -smb /nix \
  