I found some help with this post.
First I added
boot.resumeDevice = "/dev/disk/by-uuid/efb2c8a0-169b-4d4f-b09f-f656f617a49e";
But in order to resume from a swap file the resume_offset kernel parameter needs to be set.
boot.kernelParams = [ "resume_offset=21317632" ];
The arch wiki provided details on how to get the offset of the swapfile.
To test this I opened some windows and mousepad with some text and then closed the laptop lid. When the lid is open the normal bootloader opens the kernel and it resumes from the swap file. All of the windows were still open correctly.