US granting agencies operate salary splits on an "% effort" basis. See for example https://www.nsf.gov/bfa/dias/caar/time.jsp which stipulates that your effort must:
Reasonably reflect the total activity for which the employee is compensating across all grant-related and non-grant related activities (100% effort)
Support the distribution of employee salary across multiple activities or cost objectives (for example, effort spent on multiple federal awards, spent on general/or administrative activities, vacation, sick leave, leave without pay, etc.)
You can't be paid twice for the same time, the government doesn't recognize 'overtime' (the same is true for most salaried positions in the private sector), so while you could potentially work part time on a NSF (or other federal) grant and part time teaching, you can't have over 100% effort (post-game sports interviews notwithstanding).
I'm not as familiar with summer NSF grants as others are here, since my field is mostly NIH-funded and year-round, but my understanding that these are typically meant to fund someone full-time over the duration of the grant, so you would be expected to put 100% of your effort towards the work that grant funds during that time. You would not be able to teach while certifying that you've put 100% effort towards the grant paying your salary.
Ask your administration, though, if there is any way to manage things differently.