We consider quasi-one-dimensional Ruderman-Kittel-Kasuya-Yosida (RKKY) systems in proximity to an s-wave superconductor. We show that a 2k(F) peak in the spin susceptibility of the superconductor in the one-dimensional limit supports helical order of localized magnetic moments via RKKY interaction, where k(F) is the Fermi wave vector. The magnetic helix is equivalent to a uniform magnetic field and very strong spin-orbit interaction (SOI) with an effective SOI length 1/2k(F). We find the conditions to establish such a magnetic state in atomic chains and semiconducting nanowires with magnetic atoms or nuclear spins. Generically, these systems are in a topological phase with Majorana fermions. The inherent self-tuning of the helix to 2k(F) eliminates the need to tune the chemical potential.