How do I enable Swap only for Hibernation, but not ever for RAM extension (if not needed)?

I read this about macbooks, if you extend your too little RAM with your SSD the Terabytes of write can wear down that SSD very quick.

So I want to disable the swap, after already decreasing the swappiness, as I have enough RAM. Only if the RAM would be too little, I could use the swap / zram file.

Another thing still is trying to enable hibernation.

Maybe, but with the newer SSDs it is very unlikely that you would see a problem while your mac is still alive.

By default fedora uses zram for virtual swap in RAM so it never touches a physical swap for most users. If needed you can add a swap partition or swap file for use with hibernation or suspend. In my experience the physical swap never gets touched unless the zram overflows or high memory usage forces it. Default settings for zram and swappiness seem proper to work for all except the most extreme cases.

I believe that for a mac that uses the nvidia GPU it may be necessary to have physical swap adequate to support saving the content of both GPU memory and system RAM for hibernation/suspension.