Expressions for the potentials appearing in the nonrelativistic effective field theory description of doubly heavy baryons are known in terms of operator insertions in the Wilson loop. However, their evaluation requires nonperturbative techniques, such as lattice QCD, and the relevant calculations are often not available. We propose a parametrization of these potentials with a minimal model dependence based on an interpolation of the short- and long-distance descriptions. The short-distance description is obtained from weakly-coupled potential NRQCD and the long-distance one is computed using an effective string theory. The effective string theory coincides with the one for pure gluodynamics with the addition of a fermion field constrained to move on the string. We compute the hyperfine contributions to the doubly heavy baryon spectrum. The unknown parameters are obtained from heavy quark-diquark symmetry or fitted to the available lattice-QCD determinations of the hyperfine splittings. Using these parameters we compute the double charm and bottom baryon spectrum including the hyperfine contributions. We compare our results with those of other approaches and find that our results are closer to lattice-QCD determinations, in particular for the excited states. Furthermore, we compute the vacuum energy in the effective string theory and show that the fermion field contribution produces the running of the string tension and a change of sign in the L\"uscher term.