Cosmic nebula formation