Nano and Uno have almost exactly the same schematic, but for some special reason, selecting Nano in the IDE reduce limits the ROM size by 1536 bytes.
This is because Nano has different bootloader size than Uno, in the past.
Both are the same now, but we're wasting ROM at the team's decision to keep things consistent.
Rewrite bootloader with miniCore.
Then use it as a miniCore forever.
It's down to different bootoaders, burn the UNO bootload to the NANO (First thing I always do when I buy one, after testing.)
This gives you the smaller bootload, so more space. If you have a programmer, you can use the Minicore linked above to give you ALL the flash space.