Preheat oven to 425. Cut the squash in half, scoop out seeds, and then cut the halves into 1-inch pieces. Place in baking dish with ½ an inch of water. Bake until soft, 45-60 minutes.
Meanwhile, roll out pie crust and arrange in pie plate. Poke all over with a fork.
Melt butter, add leeks, and sauté until soft, about 10 minutes.
Beat together eggs, sour cream, salt, and pepper.
When the squash is done, lower oven to 350. Transfer squash to the large bowl and mash. Beat in the egg mixture, then stir in leeks.
Spread squash mixture into pie crust. If you have any leftover pie crust, cut it into strips and use it to make a sort of lattice, then sprinkle with cheese.
Bake until firm and golden, about 45 minutes. When it’s nearly done, sprinkle with pine nuts. (They’ll burn if they toast for more than a few minutes.)
Remove from oven and let cool for 5 minutes. Slice and serve.