As promised, here is a more official solution.
To create working NoMachine script for Runit you need to follow these steps. Note that you need root permission to perform those actions.
First please create runit directory for nomachine. You can do this by command mkdir /etc/sv/nomachine/
.
Next you need to create file /etc/sv/nomachine/run
and write those lines inside:
#!/bin/bash
exec /usr/NX/bin/nxexec /etc/NX/nxserver --daemon
Note that if you installed NoMachine in different location than /usr/NX
you need to replace /usr/NX/bin/nxexec
to <place NoMachine is installed>/bin/nxexec
When the file is created you need to set execute permission by chmod +x /etc/sv/nomachine/run
.
Last command will create link for service and enable it:
ln -s /etc/sv/nomachine /var/service/