This is a flake that knows how to build and flash MicroPython. It can either be invoked directly to build a basic firmware, or it can be used as an input flake and be used as a tool to build a custom firmware.
nix run github:jonahbron/micropython-builder#flash-esp32c3-generic
See examples directory or a real project for how to use this builder in your own flake. The examples are also a flake and can be run directly.
Currently Supported Ports/Boards
Note
Contributions of other MicroPython ports/boards are extremely welcome!
TODO
- Flake package that can be run like
nix build .#esp32c3-generic- Default output is firmware.bin
- Other output portions can be accessed too
nix build .#esp32GenericC3.bootloader
- Flake package that can be run like
nix run .#flash-esp32-generic - Flake library that can be called like
buildMicroPythonFirmware- Allows specifying the port/board
- Accepts arguments pointing to manifest.py
- Accepts arguments pointing to user_c_modules
- Allow patch phase script
- Allow overriding the micropython source
- Allow overriding the micropython-lib source
- Flake library that can be called like
flashMicroPythonFirmware - Make interface more ergonomic, require less knowledge
- Make fixed-output derivations optional
- Factor out common ESP32 expressions
- Allow generating firmware with LittleFS partitions/other partition table customizations
- Add nix formatter
- Flake template
- GitHub Action that attempts to regularly update dependencies
- Contribute into nixpkgs?