A single variational theory is proposed to explain the self-organization of the plasma in tokamaks and RFPs. It is assumed that the plasma relaxes towards a state of minimum entropy production rate and that the entropy is produced through mean conduction as well as turbulence. Pressure equilibrium and generalized Ohm's law are considered to be the most important constraints upon the quasi-equilibrium configuration. Numerical calculations reproduce typical observations in RFPs and tokamaks.