UEFI boot entry deleted -> Configure startup.nsh

There have been several topics on disappearing UEFI boot entry for Qubes, when booting into Windows or changing the internal drive. Those offered a few commands to manually repair/restore the boot entry.

Marmarek explained that is unfortunately how many UEFI implementations behave:

Two possible fallbacks were discussed, but the PR’s have not been merged yet.
One is the startup.nsh file:

It is possible to manually create this file from Dom0 terminal, to avoid having to repair the boot entry later?
If so, could someone provide the commands to do this?

sudo tee /boot/efi/startup.nsh <<< '\EFI\qubes\grubx64.efi'

Thanks rustybird!