Combine egg, sour cream, butter, chives, and salt with your hands in a bowl. Don't worry if mixture is not uniform and, as with pie dough, don't overwork it. Add flour and mix with your hands until a dough forms. Wrap in plastic and refrigerate the dough at least 2 hours or up to 2 days.
Put potatoes in a large pot and cover with 2 inches cold water. Bring to a boil. Season water generously with salt. Reduce heat to maintain a simmer and cook until a knife easily pierces potatoes. Drain and return potatoes to same pot. Mash, slowly mixing in hot cream and cold butter. Season with salt and pepper to taste and set aside.
Warm olive oil in a large skillet over medium-high heat. Cook bacon until crisp (10 minutes). Transfer to a plate with a slotted spoon.
Reduce heat to medium, toss onions into pan, and coat with bacon fat. Season with salt and pepper. Cook, stirring frequently, until onions are caramelized and sweet (20 minutes). Let cool.
Butter a casserole dish. Preheat oven to 350 degrees F.
Roll pierogi dough out with a rolling pin to a 1/8 inch thick rectangle. Cut into 4 inch by 13 inch strips, re-rolling scraps as necessary. You will need 14 to 20 strips.
Have mashed potatoes, crisp bacon, caramelized onions, pasta strips, and cheeses ready on a work surface. Arrange 1 layer pierogi dough strips on bottom of buttered casserole dish, slightly overlapping edges of strips.
Spread a 1/2 inch layer of potatoes on top of dough. Top with some caramelized onions, bacon, and a sprinkling of both Gruyere and farmer's cheese. Repeat layers to use remaining ingredients. Finish with dough on top, followed by Gruyere and farmer's cheese. Season top with pepper.
Cook until lasagna is bubbly and cheese on top is golden brown, about 40 minutes. Let rest 15 to 20 minutes and then serve with a dollop of sour cream and a sprinkle of chives.