Template: Flake Parts Modules
The flake-parts-modules template demonstrates how to use Den aspects
that propagate custom classes into third-party flake-parts perSystem modules.
For demo purposes, the example showcases:
perSystem.packages: How to expose flake-parts packages.numtide/devshell: A default devshell extensible by any aspect.mightyiam/files: Generates README from nix code.nix-community/nix-unit: Write tests directly on aspects.
Initialize
Section titled “Initialize”mkdir example && cd examplenix flake init -t github:vic/den#flake-parts-modulesnix flake update dennix flake shownix flake check -LProject Structure
Section titled “Project Structure”flake.nixmodules/ perSystem-forward.nix # Custom den.ctx and perSystem forwarding class. custom-classes.nix # Registers several classes for each third-party den.nix # Example of aspects using those classesKey points:
- New
perSystemclasses are registered via a context transition, from any module.
Next Steps
Section titled “Next Steps”- Read flake.parts Documentation for more
perSystemmodules.