The nucleus houses, organizes, and protects chromatin to ensure genome integrity and proper gene expression, but how the nucleus adapts mechanically to changes in the extracellular environment is poorly understood. Recent studies have revealed that extracellular physical stresses induce chromatin compaction via mechanotransductive processes. We report that increased extracellular multivalent cations lead to increased heterochromatin levels through activation of mechanosensitive ion channels (MSCs), without large-scale cell stretching. In cells with perturbed chromatin or lamins, this increase in heterochromatin suppresses nuclear blebbing associated with nuclear rupture and DNA damage. Through micromanipulation force measurements, we show that this increase in heterochromatin increases chromatin-based nuclear rigidity, which protects nuclear morphology and function. In addition, transduction of elevated extracellular cations rescues nuclear morphology in model and patient cells of human diseases, including progeria and the breast cancer model cell line MDA-MB-231. We conclude that nuclear mechanics, morphology, and function can be modulated by cell sensing of the extracellular environment through MSCs and consequent changes to histone modification state and chromatin-based nuclear rigidity.