You can easily cross-compile an Arduino firmware with NectarJS. You first need to install avr-gcc on your platform.
Once done, you can try to compile one of the example:
mkdir examplescd examplesnectar --examplesnectar arduino-led.js --env arduino --target nano
You can directly flash an Arduino connected in USB using the --flash flag