  We determine the Krieger type of nonsingular Bernoulli actions $G
\curvearrowright \prod_{g \in G} (\{0,1\},\mu_g)$. When $G$ is abelian, we do
this for arbitrary marginal measures $\mu_g$. We prove in particular that the
action is never of type II$_\infty$ if $G$ is abelian and not locally finite,
answering Krengel's question for $G = \mathbb{Z}$. When $G$ is locally finite,
we prove that type II$_\infty$ does arise. For arbitrary countable groups, we
assume that the marginal measures stay away from $0$ and $1$. When $G$ has only
one end, we prove that the Krieger type is always I, II$_1$ or III$_1$. When
$G$ has more than one end, we show that other types always arise. Finally, we
solve the conjecture of [VW17] by proving that a group $G$ admits a Bernoulli
action of type III$_1$ if and only if $G$ has nontrivial first
$L^2$-cohomology.
