Code written in version 1.0 will always keep working if you just compile it with the 1.0 compiler. Unlike Python and other dynamic languages you can just compile your binary and it will work forever (or at least until an external dependency is updated).
That being said 2.0 and 1.0 are pretty similar and unless you rely on some quite specific behaviors it is very likely that your code should keep working. Have a look at the backwards compatibility section here to figure out what might have to be updated: https://nim-lang.org/blog/2022/12/21/version-20-rc.html
To test the changes, you can compile your code with the latest devel version or the specific #version-2-0. It is the second release candidate of Nim 2.0. You can seamlessly change back to Nim 1.0 with Choosenim.
The main breaking change for me is named versus pure enums.