Nails are part of the crafting system recently introduced in DayZ 1.8. They are currently used by a few recipes (baseball bat variants, and for upgrading stashes), and for base building.
They are a fairly common item, found in the Supermarkets, residential, farm buildings and train waggons. They take up 1 slot and do not stack.