  A measurement of charm mixing and $CP$-violating parameters is reported,
using $\bar{B} \rightarrow D^0 ( \rightarrow K_S^0 \pi^+ \pi^-) \mu^-
\bar{\nu}_\mu X$ decays reconstructed in proton-proton collisions collected by
the LHCb experiment during the years 2016 to 2018, corresponding to an
integrated luminosity of 5.4 fb$^{-1}$. The measured mixing and $CP$-violating
parameters are $$x_{\rm CP} = [ \,\,\,\,\,4.29 \pm 1.48 \mbox{(stat)} \pm 0.26
\mbox{(syst)} ] \times 10^{-3}\,,$$ $$y_{\rm CP} = [ \,\,12.61 \pm 3.12
\mbox{(stat)} \pm 0.83 \mbox{(syst)} ] \times 10^{-3} \,,$$ $$\Delta x \,\,= [
-0.77 \pm 0.93 \mbox{(stat)} \pm 0.28 \mbox{(syst)} ] \times 10^{-3} \,,$$
$$\Delta y \, = [ \,\,\,\,\,3.01 \pm 1.92 \mbox{(stat)} \pm 0.26 \mbox{(syst)}
] \times 10^{-3} \,.$$ The results are complementary to and consistent with
previous measurements. A combination with the recent LHCb analysis of $D^{*+}
\rightarrow D^0 ( \rightarrow K_S^0 \pi^+ \pi^-) \pi^+ $ decays is reported.
