What is flake-parts and why use modules?
mainflake-parts is a distributed framework for writing Nix Flakes. It provides a module system for flakes, allowing you to:
- Refactor configuration: Split your
flake.nixinto focused, reusable modules. - Manage systems: Simplify the handling of
perSystemattributes (e.g., building different outputs forx86_64-linuxvsaarch64-darwin). - Reduce glue code: Avoid writing custom Nix logic to manage flake outputs.
- Enable integration: Allow users of your library to easily integrate your generated flake outputs into their own flakes.
flake-parts itself acts as a minimal mirror of the Nix flake schema, while providing an ecosystem of opinionated modules for advanced features.