# Arduino IDE environment

**URL:** https://discourse.nixos.org/t/arduino-ide-environment/2086
**Category:** Guides
**Created:** [February 9, 2019, 4:51pm UTC](https://discourse.nixos.org/t/arduino-ide-environment/2086 "2019-02-09T16:51:25Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Mic92](https://discourse.nixos.org/user_avatar/discourse.nixos.org/mic92/32/5265_2.png) [@Mic92](https://discourse.nixos.org/u/Mic92)
#### Post date: [February 9, 2019, 4:51pm UTC](https://discourse.nixos.org/t/arduino-ide-environment/2086/1 "2019-02-09T16:51:25Z")

</div>

I noticed that when running the Arduino IDE it would also download the toolchain for my ESP32, which obviously does not work on NixOS without patchelf.

However it is pretty straight forward to get it working using fhsUserEnv.  
In case someone needs it:

```plaintext
$ nix-shell https://github.com/nix-community/nix-environments/archive/master.tar.gz -A arduino

```

Further [infos](https://github.com/nix-community/nix-environments/tree/master/envs/arduino)

---

<div class="post-metadata">

### Author: ![fbmnds](https://discourse.nixos.org/user_avatar/discourse.nixos.org/fbmnds/32/1558_2.png) [@fbmnds](https://discourse.nixos.org/u/fbmnds)
#### Post date: [August 18, 2019, 9:30am UTC](https://discourse.nixos.org/t/arduino-ide-environment/2086/2 "2019-08-18T09:30:33Z")

</div>

The ESP32 toolchain can also be obtained independently from Arduino, as described here: [ESP-IDF - NixOS Wiki](https://nixos.wiki/wiki/ESP-IDF)

I updated the file for the current toolchain version 2019r1:

- default.nix: [ESP-IDF · GitHub](https://gist.github.com/fbmnds/e069ffa413fb14a0ff548217ded88302)

- esp32-toolchain.nix: [ESP-IDF · GitHub](https://gist.github.com/fbmnds/56b74de6f87fc4a1fb4c46db3af6d4fa)

---

<div class="post-metadata">

### Author: ![joonazan](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@joonazan](https://discourse.nixos.org/u/joonazan)
#### Post date: [February 17, 2020, 4:44pm UTC](https://discourse.nixos.org/t/arduino-ide-environment/2086/3 "2020-02-17T16:44:51Z")

</div>

@fbmnds It seems that you have accidentally pasted the first file into your esp32-toolchain.nix.

---

<div class="post-metadata">

### Author: ![JanKaifer](https://discourse.nixos.org/user_avatar/discourse.nixos.org/jankaifer/32/3829_2.png) [@JanKaifer](https://discourse.nixos.org/u/JanKaifer)
#### Post date: [March 2, 2021, 5:32pm UTC](https://discourse.nixos.org/t/arduino-ide-environment/2086/4 "2021-03-02T17:32:04Z")

</div>

There is a package `arduino` in the stable that seems to work: [NixOS Search](https://search.nixos.org/packages?channel=20.09&show=arduino&from=0&size=50&sort=relevance&query=arduino)

Correct me please if the workaround above is still required.

---

<div class="post-metadata">

### Author: ![jrestivo](https://discourse.nixos.org/user_avatar/discourse.nixos.org/jrestivo/32/4224_2.png) [@jrestivo](https://discourse.nixos.org/u/jrestivo)
#### Post date: [April 25, 2021, 6:11pm UTC](https://discourse.nixos.org/t/arduino-ide-environment/2086/5 "2021-04-25T18:11:31Z")

</div>

I believe it is. Arduino IDE will still on-demand download the cross compiler toolchain for your board (for example, avr) into a subdirectory in your $HOME. And then it will fail to compile your code because those binaries are unpatched.
