flipperzero-firmware icon indicating copy to clipboard operation
flipperzero-firmware copied to clipboard

Add Nix expressions to build firmware with Nix

Open adisbladis opened this issue 1 year ago • 4 comments

What's new

Nix is distro & language agnostic package manager that can also be seen as a meta build system. This can be used to build on any Linux distro as long as the Nix package manager is installed, and possibly also on MacOS though I haven't tested this myself.

This is intended to be used either purely for building the firmware. Building like this runs the build inside a sandbox.

  • $ nix-build ./.

Or interactively using nix-shell:

  • $ nix-shell
  • $ ./fbt firmware_flash

Verification

  • Run above steps.

Checklist (For Reviewer)

  • [ ] PR has description of feature/bug or link to Confluence/Jira task
  • [ ] Description contains actions to verify feature/bugfix
  • [ ] I've built this code, uploaded it to the device and verified feature/bugfix

adisbladis avatar Jul 20 '22 11:07 adisbladis

Marking as draft since it's blocked by https://github.com/flipperdevices/flipperzero-firmware/pull/1419

adisbladis avatar Jul 20 '22 11:07 adisbladis

Hi,

Thanks for contribution, but I'm not sure that we ready to include it:

  • We have some specific toolchain requirements and we don't support building with 3rd party toolchains, so we are not ready to support one more build system that doesn't cover all our target platforms and requires another set of dependencies
  • As for version from environment it looks good though we don't pack source packages, that part we'll merge

skotopes avatar Jul 20 '22 11:07 skotopes

@skotopes haha nix community go brrr

cab404 avatar Jul 20 '22 14:07 cab404

Just want to confirm that this still works on Apple M1 Macbooks, and lets me build this firmware without the need to install anything with homebrew. Thanks @adisbladis!

chrippa avatar Sep 24 '22 23:09 chrippa