CVS Health Corp., the biggest U.S. retailer of prescription drugs, agreed to acquire nursing-home pharmacy Omnicare Inc. for a total enterprise value of $12.7 billion. Omnicare, with a market value of about $9.2 billion, hired advisers to explore a sale earlier this year. Omnicare delivers drugs and helps senior-living facilities manage residents’ medications.