astro / nix-openwrt-imagebuilder

Build OpenWRT images in Nix derivations
MIT License
129 stars 16 forks source link

builder: Improve phases #42

Closed pedorich-n closed 3 months ago

pedorich-n commented 3 months ago

This PR is my proposal on how to make the build process more modular and overridable by extracting the arguments passed to the make into a preBuild phase and re-using the default buildPhase for make from nixpkgs. Also, more code moved from buildPhase to configurePhase. In my opinion, it makes more sense there, as it prepares the code for the build, rather than doing anything related to the build itself.

With this approach, applying client-side overrides like https://github.com/astro/nix-openwrt-imagebuilder/issues/38 should be easier now.

Let me know what you think.

astro commented 3 months ago

Thank you very much!