
Put flour in your mixer bowl. Add water, egg, oil, and salt to flour and turn mixer on to low. Knead until a soft dough forms. Continue kneading adding flour as needed to keep dough from sticking, until smooth and elastic, about 8 minutes (dough will be very soft). Cover with a damp cloth and let stand at room temperature 1 hour.
Peel potatoes and cut into chunks. Cook potatoes in a large saucepan of boiling, salted water until tender, about 8 minutes. Drain potatoes then add cheese, salt, pepper, and nutmeg and mash with a potato masher. Set aside to cool.
Melt butter in a medium saucepan over moderately low heat, add onions stirring occasionally until golden brown, about 30 minutes. Remove from heat and season with salt and pepper. Place onions in a 3 quart baking dish.
Using 1 half of the dough, roll out on lightly floured surface into a 15-inch circle. Cut out 24 rounds with lightly floured 2 1/2" cutter.
Hold 1 round in palm of your hand and brush edges lightly with water. Put 1 tablespoon potato mixture in center and close your hand to fold round in half, enclosing filling. Pinch edges together to seal completely. Place on a lightly floured surface. Form more pierogies in same manner. Continue with the remaining dough.
Bring a 6 quart pot of salted water to a boil. Add half of pierogies, stirring once or twice to keep them from sticking together, and cook 5 minutes from the time pierogies float to surface. Transfer with a slotted spoon to the pan with the onion topping and toss gently to coat. Cook remaining pierogies in same manner, coating with onions when done.
Reheat pierogies in onion topping in a 300 degree oven for 15 minutes.

