OP - if you haven't seen this, checkout Paul's build:
Custom Generator Shelter - YouTube
4Shorts on here - quiet lately, and I'm glad to see on Youtube that he is doing well. (2 heart attacks earlier this year).
IIRC, Paul used to be a Honda small engine tech, so he knows that generator well. Everything he builds is first class. Vid is worth watching just for the construction techniques, and ventilation setup.
Two things to consider re. proximity:
1) Sound transmission. If you have the space, it's usually a lot easier to remote the shed than to try and mitigate noise transmission
after you build against the house and
then find out you have a problem.
2) Fire/Code/Insurance....... I have no idea of your particulars, but suffice to say that in most areas a detached
garage is cheaper to insure than an attached one.
After building an attached shed is not a great time to find out your insurance company is threatening to cancel (worse yet, during a claim).
Rgds, D