Add index-state support to horizon-spec
Adds support for reproducible package resolution using index-state timestamps, similar to cabal.project's index-state feature.
Schema Changes
HaskellSource type:
- Replace
FromHackagewithFromIndex { index : Text, name : Text, version : Version } - The
indexfield contains repository base URL (e.g., "https://hackage.haskell.org")
New types:
IndexState = List { index : Text, timestamp : Text }-
ExportSettingsbase type withpackagesDirandindexStatefields
Export settings:
-
PackageSetExportSettings: Now extendsExportSettings(includesindexStatefield) -
OverlayExportSettings: Now extendsExportSettings(includesindexStatefield)
New Helper Functions
-
callIndex: For custom package indices with any repository URL -
callCHaP: Shortcut for Cardano Haskell Packages (https://chap.intersectmbo.org) -
callHackage: Updated to use FromIndex with https://hackage.haskell.org
How It Works
- Repository base URLs are used as identifiers (e.g., "https://hackage.haskell.org")
- horizon-gen-nix will fetch indices by appending
/01-index.tar.gzto the URL - Optional
indexStateconfiguration allows pinning package availability to specific timestamps - This enables pure, reproducible package resolution
Dependencies
This MR is based on !15 (merged) (gitlab-ci 0.8.0 update) and can be merged after !15 (merged) is merged.