Beat eggs in a large mixing bowl. Mix in nutmeg, salt, and pepper.
Slowly add flour until evenly mixed. Stop stirring as soon as the batter is smooth.
Cover the dough with a damp towel and let it rest for 30 minutes.
While the dough is resting, melt 2 T. butter in a large skillet over medium-high heat. Add onion rings and let caramelize to a golden brown.
Remove the onions, then melt remaining 2 T. butter in the skillet. Turn off the heat and leave the skillet on the stove.
Bring a large pot of salted water to a simmer. Wet a wooden cutting board in the sink.
Roll out the dough as thinly as you can on the damp cutting board. Slice dough into very thin strips, then use the back of the knife to slide small strips into the boiling water one at a time.
Remove the spätzle with a slotted spoon a minute after they float, about 2-3 minutes after they were added to the water, and transfer to the skillet with melted butter.
Once all the spätzle have been cooked and added to the skillet, turn on the burner to medium heat. Toss to coat all the spätzle with butter and cook for 2 minutes.
Add the shredded cheese and toss until all the cheese has just melted, then remove from heat.
Serve immediately topped with caramelized onions.