Isometrically embedding theorem

The well-known Nash embedding theorem states that any Riemannian manifold $M$ can be isometrically embedded to some Euclidean space $R^k$.

My question is: Can any Riemannian manifold $M$ be isometrically embedded to some Riemannian manifold $N$ with trivial tangent bundle such that $M$ is totally geodesic? Of course this $N$ cannot be $R^k$ unless $M$ is flat.

Start with a smooth embedding $M^m\to R^k$. Let $\nu_M$ be the normal bundle. Then $TM\oplus \nu_M$ is a trivial bundle over $M$. Notice that the orthogonal group $O(n), n=k-m$, acts smoothly on $\nu_M$, linearly on each fiber. I will identify $M$ with the image of the zero section of $\nu_M$. Then the above action of $O(n)$ preserves the metric $g$ on $M$ since $O(n)$ fixes $M$ pointwise. Extend the Riemannian metric $g$ from $M$ to the total space $E$ of $\nu_M$ to a Riemannian metric $h$ on $E$. Next, average $h$ over $O(n)$ (which we equip with the smooth invariant measure of unit volume) and obtain a new metric $\hat{g}$ on $E$ which is $O(n)$-invariant and whose restriction to $M$ is $g$. Then $M$ is totally geodesic in $(E, \hat{g})$ since it is the set of fixed points of an isometric group action. The manifold $E$ is parallelizable, since $TM\oplus \nu_M$ is trivial.