  The theory of inflation provides an elegant explanation for the nearly flat
universe observed today, which represents one of the pillars of the standard
cosmological model. However, recent studies have reported some deviations from
a flat geometry, arguing that a closed universe would be instead favored by
observations. Given its central role played in the cosmological context, this
paper revisits the issue of spatial curvature in light of the stochastic
gravitational wave background signal recently detected by the NANOGrav
collaboration. For this purpose, we investigate the primordial gravitational
waves generated during inflation and their propagation in the post-inflationary
universe. We propose a new parametrization of the gravitational wave power
spectrum, taking into account spatial curvature, the tensor-to-scalar ratio and
the spectral index of tensor perturbations. Therefore, we compare the
theoretical predictions with NANOGrav data to possibly constrain the geometry
of the universe. We find that the choice of the priors has a significant effect
on the computed posterior distributions. In particular, using flat uniform
priors results in $\Omega_{\mathcal{K},0}= 0.00 \pm 0.67$ at the 68\%
confidence level. On the other hand, imposing a Planck prior, we obtain
$\Omega_{\mathcal{K},0}= -0.05 \pm 0.17$ at the 68\% confidence level. This
result aligns with the analysis of the cosmic microwave background radiation,
and no deviations from a flat universe are found.
