The law changed in this area on 6th April 2018 to make all notice payments or sums attributable to the notional notice period taxable in full as earnings. This means that all notice pay is now subject to both tax and national insurance. It does not matter whether your contract of employment allows for notice to be paid in one lump sum or not.
If your settlement agreement provides for only one lump sum as an ex gratia payment, this should be changed. The notice payment should be separated and taxed leaving the ex gratia sum as a tax-free settlement. This carries less risk as you will usually be required to indemnify your employer for tax on any ex gratia sum (tax indemnity). You can read more about tax indemnity in the FAQs.