I am currently planning to replace/expand my front porch (almost the whole width of my 1920's cape) and hope to put a pergola over it. Due to the small amount of space between the top of the window and the fascia/gutter, I was planning to run the rafters over the gutter onto the existing roof. I would conceal the gutter with trim boards to match the header on the outer side of the porch. My question is, how should I fasten the rafters to the house roof and what would the best way to flash them as well. The only idea I had was to strip back the shingles, install a nailer and flash over that and down into the gutter.

Is this a bad idea or is there another easier way?