Halite endoliths in the Atacama Desert represent one of the most extreme microbial ecosystems on Earth. Here we sequenced and characterized a shotgun metagenome from halite nodules collected in Salar Grande, Chile. The community is dominated by archaea and functional analysis attributed most of the autotrophic CO2 fixation to a unique cyanobacterium. The assembled 1.1 Mbp genome of a novel nanohaloarchaeon, Candidatus Nanopetramus SG9, revealed a photoheterotrophic life style and a low median isoelectric point (pI) for all predicted proteins, suggesting a “salt-in” strategy for osmotic balance. Predicted proteins of the algae identified in the community also had pI distributions similar to “salt-in” strategists. The Nanopetramus genome contained a unique CRISPR/Cas system with a spacer that matched a partial viral genome from the metagenome. A combination of reference-independent methods identified over 30 complete or near complete viral or proviral genomes with diverse genome structure, genome size, gene content, and hosts. Putative hosts included Halobacteriaceae, Nanohaloarchaea, and Cyanobacteria. Despite the dependence of the halite community on deliquescence for liquid water availability, this study exposed an ecosystem spanning three phylogenetic domains, containing a large diversity of viruses, and a predominant salt-in strategy to balance the high osmotic pressure of the environment.