Relocating for work Jan 2018. Employer is paying a sum on 12/31/17 for expenses. I understand this income is taxable. Can I still deduct moving expenses on 2017 taxes?

I started working for this employer at the end of November 2017. At that time, we agreed I would relocate (across country) for the job as soon as reasonably possible. In December, we sold our home (closing in January) and purchased a new one (also closing in January) and are physically moving on January 5th, 2018. 

From what I understand, moving expenses will no longer be deductible starting in 2018. Am I just out of luck here or can I still deduct moving expenses because this was all in motion (and documented via my offer letter from the new employer) in 2017?