nursing pillow. is it safe ?

♡ 𝓚𝓪𝓽𝓻𝓲𝓷𝓪 𝓵𝓸𝓾𝓲𝓼𝓮 ♡
My newborn son is 5 weeks old and he has outgrown his Moses basket so he is using his cot (crib) now. He moves around a lot in his sleep especially his legs, they move so much that he can never settle and wakes up easily and cries cause he cannot basically get comfortable.
This as you can imagine got unbearable for me as it meant I wasn't getting sleep either so I would let him just sleep on my chest
Recently though I purchased a moon shaped nursing pillows which is designed for multipurpose use for the baby. I put him on it today and wrapped the cushion bit just over his hips so it feels like he is getting hugged and he has had a very peaceful sleep.
My question is, is it safe for him to sleep like that ? On the cushion ? There's nothing else in the cot with him , not even a blanket