  The combination of linear and nonlinear potentials, both shaped as a single
well, enables competition between the confinement and expulsion induced by the
former and latter potentials, respectively. We demonstrate that this setting
leads to spontaneous symmetry breaking (SSB) of the ground state in the
respective generalized nonlinear Schr\"{o}dinger (Gross-Pitaevskii) equation,
through a spontaneous off-center shift of the trapped mode. Two different SSB
bifurcation scenarios are possible, depending on the shape of the
nonlinearity-modulation profile, which determines the nonlinear potential. If
the profile is bounded (remaining finite at $|x|\rightarrow \infty $), at a
critical value of the integral norm the spatially symmetric state loses its
stability, giving rise to a pair of mutually symmetric stable asymmetric ones
via a direct pitchfork bifurcation. On the other hand, if the nonlinear
potential is unbounded, two unstable asymmetric modes merge into the symmetric
metastable one and destabilize it, via an inverted pitchfork bifurcation.
Parallel to a systematic numerical investigation, basic results are obtained in
an analytical form. The settings can be realized in Bose-Einstein condensates
and nonlinear optical waveguides.
