Power Spectral Density from Probability Density Function The samples of a signal $x[n]$ are i.i.d. and follow a triangular pdf with $a = 0,\ b = 2,\ c = 1$:

The DC-power of the signal is
$$\mu_x^2 = \big(\mathbb{E}(X)\big)^2 = \left(\int_{-\infty}^{\infty} x f_x(x)dx\right)^2 = 1$$
the total power of the signal
$$\mathbb{E}(X^2) = \int_{-\infty}^{\infty} x^2 f_x(x)dx = \frac{7}{6}$$
and the variance (AC-power) as
$$\sigma^2 = \mathbb{E}\big((X-\mu_x)^2\big)= \mathbb{E}\left(X^2\right)-\mu_x^2 = \frac{1}{6}$$.
Thus I thought, that the PSD of the signal has the following form:
$$ S_{xx}(e^{j\omega}) = 2\pi \delta(\omega) + \frac{1}{6}$$
as the AC-power results in a constant value over the whole spectrum and the DC power in a Dirac-Delta at $\omega = 0$. Furthermore, the integration over the PSD should return the total power of the signal:
$$ \frac{1}{2\pi} \int_{-\pi}^{\pi} S_{xx} dx = \mathbb{E}(X^2) $$
Is my solution correct or did I miss something? Can this procedure be done for every probability density function under the assumption that all samples of $x[n]$ are iid?
If the $x[n]$ are i.i.d. random variables with mean $\mu$ and variance $\sigma^2$, then the power spectral density of this discrete-time random process (which is effectively white noise plus a possibly nonzero mean $\mu$) is what you have calculated.  The shape of the common pdf of the random variables is irrelevant in all this except insofar as the shape determines the mean and variance; for example. you would get the same PSD if the $x[n]$ were Gaussian random variables with mean $\mu$ and variance $\sigma^2$.