Make the Pastry:
In a bowl, rub the cold butter into the flour and salt until it resembles breadcrumbs. Add cold water gradually until a dough forms. Wrap and chill for 20 minutes.
Slice the potatoes and onion very thinly. Dice the bacon. Season the potatoes with salt, pepper, and thyme.
Assemble the Pie:
Roll out half the pastry and line the pie dish. Layer potatoes, onions, bacon, and small pieces of butter. Repeat layers until full. Drizzle milk or cream over the top.
Top the Pie:
Roll out the remaining pastry, cover the pie, seal edges, and cut a small slit in the top for steam.
Bake:
Bake at 180°C (350°F) for 1½ to 2 hours, until the potatoes are tender and the crust is golden brown. Cover with foil if the top browns too quickly.
Rest and Serve:
Let the pie rest for 10 minutes before slicing. Serve hot.