Heat olive oil in a skillet over medium heat.
Add the chopped onion and cook until softened, about 5 minutes.
Stir in the minced garlic and cook for another minute.
In a bowl, combine ricotta cheese, cooked peas, sautéed onion and garlic, salt, pepper, and nutmeg. Mix well. Set aside.
In a large bowl, combine flour and salt.
Cut in the cold butter until the mixture resembles coarse crumbs.
Gradually add cold water, a tablespoon at a time, until the dough comes together.
Turn the dough onto a floured surface and knead lightly. Wrap in plastic wrap and refrigerate for at least 30 minutes.
Preheat the oven to 375°F (190°C).
Roll out the dough on a floured surface to about 1/8-inch thickness.
Cut the dough into squares or circles, about 3-4 inches in size.
Place a spoonful of filling in the center of each dough piece.
Fold the dough over to cover the filling and press the edges to seal, forming a triangle or a half-moon shape.
Place the pastizzi on a baking sheet lined with parchment paper.
Bake in the preheated oven for 25-30 minutes, or until the pastry is golden brown and crisp.
Enjoy your meal!