Heat the oil in a large skillet. Sauté the onions over medium heat until translucent. Add the carrots and continue to sauté until onions and carrots are golden.
In a mixing bowl, combine the onion-carrot mixture with all the remaining ingredients except walnuts. Mix thoroughly; don't worry if the potato slices break apart.
Transfer the mixture to a large, oiled, shallow baking dish (a round or oval shape is attractive). Sprinkle the optional walnuts over the top.
Bake for 45 to 50 minutes, or until the top begins to turn slightly crusty. Serve hot or warm from the baking dish.