anchor.diff:      # Is there a way to use kvm when not running as root?
       # Would using uml provide any advantages?
   
  -    # TODO add nix-env -i command and verify that root can install additional
  -    # tools such as git or sshfs-fuse!
  +
  +    # TODO: Run installation withoun networking support ?
  +    # This can be done by using either firewalls or building system by .drv path?
       pkgs.runCommand "nixos-installation-test" { inherit systemDerivation; } ''
  +
  +    set -e
   
       INFO(){ echo "INFO: " $@; }
   
  
positive.code: 
    # TODO test both: copyKernels = true and false. true doesn't work ?
  
  in
  
  rec {
  
negative.code:     # wait for socket
  
      waitForSSHD(){
        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
  
  