Add horizon.packageSet module with automatic README generation
Summary
This MR introduces a new horizon.packageSet flake-parts module that provides a unified interface for configuring Horizon Haskell package sets with automatic README generation.
Features
-
Dual-mode configuration:
-
Base mode: For package sets that use
haskell-make-package-setdirectly (like horizon-core) - Overlay mode: For package sets that extend existing package sets (like horizon-advance)
-
Base mode: For package sets that use
-
Automatic README generation: README.md files are generated via a treefmt formatter based on the configuration
- Package set name and description
- Required packages list
- Standard updating and building instructions
-
CI integration: When used with
nix fmt, CI builds will fail if the README is out of sync with the configuration
Configuration Example (Overlay Mode)
horizon.packageSet = {
enable = true;
name = "advance";
description = "Package set description...";
requiredPackages = [ "brick" "optics" "polysemy" ];
overlay = {
basePackages = inputs.horizon-core.legacyPackages.${system};
overlays = [ (import ./overlay.nix) ];
};
};
Testing
Tested successfully in horizon-advance with nix flake show and nix fmt.