anchor.diff:      fakeroot nixos-prepare-root $root ${channelSources} ${config.system.build.toplevel} closure
   
       echo "copying staging root to image..."
  -    cptofs ${pkgs.lib.optionalString partitioned "-P 1"} -t ${fsType} -i $diskImage $root/* /
  +    cptofs ${optionalString partitioned "-P 1"} -t ${fsType} -i $diskImage $root/* /
     '';
   in pkgs.vmTools.runInLinuxVM (
     pkgs.runCommand name
  
positive.code: with lib;
  
  let
    extensions = {
      qcow2 = "qcow2";
      vpc   = "vhd";
      raw   = "img";
    };
  
    nixpkgs = cleanSource pkgs.path;
  
  
negative.code:       exportReferencesGraph = [ "closure" metaClosure ];
        postVM = ''
          ${if format == "raw" then ''
            mv $diskImage $out/${filename}
          '' else ''
            ${pkgs.qemu}/bin/qemu-img convert -f raw -O ${format} $diskImage $out/${filename}
          ''}
          diskImage=$out/${filename}
          ${postVM}
        '';
        memSize = 1024;
  