A fire at a nursing home in western Sri Lanka killed 12 residents and injured eight others, police said.