This will likely be updated.
I saw a request for some help in setting up key-based auth in NoMachine NX tonight just as I was going to bed and decided to do that instead. I believe the request is for Mac-to-Mac, but for the moment I'm doing bi-directional Linux-to-Mac and Mac-to-Linux. If I make any changes at all in how I set the Mac side up vs the Linux side I'll note them of course.
So here is the basic Linux client to Mac server. In testing I set this up Linux-to-Linux. The commands I used were exactly the same on the Linux and Mac servers.