You are doing "interesting" things. First, I can not remember having seen nested templates at all in Nim, at least I never used that construct.
And putting a include inside a template is also "interesting". >From my memory an include should be identical to copying the content at that >location.