Skip to content

build(nix): provide ESP-IDF v6.1 in the dev shell - #201

Open
Sammyalhashe wants to merge 3 commits into
odudex:masterfrom
Sammyalhashe:nix-flake-esp
Open

Sammyalhashe wants to merge 3 commits into
odudex:masterfrom
Sammyalhashe:nix-flake-esp

Conversation

@Sammyalhashe

Copy link
Copy Markdown

Pulls ESP-IDF v6.1 (toolchains plus its Python env, including esp-idf-sbom)

Now the shell builds firmware on NixOS and macOS without a separate install.

I previously checked out #169 and took into account some of the concerns @odudex had.

@Sammyalhashe
Sammyalhashe marked this pull request as ready for review November 3, 2026 20:55
@Sammyalhashe

Copy link
Copy Markdown
Author

I forgot to mention one more thing:

I updated the shell scripts to use a more portable shebang since /bin/bash doesn't exist on nixos. But this should be more portable in general and I believe is a better practice anyways :)

@joaozinhom joaozinhom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README.md:52 still says the shell is host tools only and that firmware needs a separate ESP-IDF install. After this PR that is no longer true, so anyone following the README will install IDF by hand for no reason, or distrust the shell.

Could you update that paragraph? Something like: nix develop now provides ESP-IDF v6.1, its toolchain and Python tools, plus the host tools, so Nix users can skip the clone. The manual install stays for everyone else. just build still honours an IDF_PATH that is already set, and otherwise falls back to ~/esp/esp-idf.

Comment thread flake.nix
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
# mirrexagon/nixpkgs-esp-dev#135 (ESP-IDF v6.1) plus a libpython3.14 fix for Linux.
nixpkgs-esp-dev = {
url = "github:Sammyalhashe/nixpkgs-esp-dev/b574e8e501dfa691814c87d4151043eb991d2be9";

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there an official source for ESP-IDF?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes but until mirrexagon/nixpkgs-esp-dev#135 is merged and libpython3.14 is added as in Sammyalhashe/nixpkgs-esp-dev@b574e8e then we need this.

Once this is added I can revert back.

Pulls ESP-IDF v6.1 (toolchains plus its Python env, including
esp-idf-sbom) from a fork of mirrexagon/nixpkgs-esp-dev#135 that also
fixes Linux builds of the 6.1 gdb, so the shell builds firmware on NixOS
and macOS without a separate install.
@Sammyalhashe

Copy link
Copy Markdown
Author

README.md:52 still says the shell is host tools only and that firmware needs a separate ESP-IDF install. After this PR that is no longer true, so anyone following the README will install IDF by hand for no reason, or distrust the shell.

Could you update that paragraph? Something like: nix develop now provides ESP-IDF v6.1, its toolchain and Python tools, plus the host tools, so Nix users can skip the clone. The manual install stays for everyone else. just build still honours an IDF_PATH that is already set, and otherwise falls back to ~/esp/esp-idf.

This has been done by the way.

- Use /usr/bin/env bash shebangs; NixOS has no /bin/bash.
- Disable fortify hardening in the dev shell: it adds glibc's
  warn_unused_result to posix_memalign, which -Werror rejects.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants