Interplay between superconductivity and ferromagnetism in crystalline nanowires