Lived in NYS from 01 to 06/2018. Received income from NYS-based employer from 01 to 08/2018. Would I report only the income from 01 to 06 as "New York resident" income?

I lived in New York State (NYC to be exact) from January 2018 to June 2018, at which point I moved to Texas. However, I continued to be employed by my NYS-based employer until August 2018. Regarding allocation of income, I'm assuming I would report the income I earned from January to June as "New York resident" income and the income I earned from July to August as "nonresident income"? The potential difference in my refund is quite large depending on how I allocate my income, so any insight into this would be much appreciated. Thank you!