Skip to content

Add index-state support to horizon-spec

Horizon Bot requested to merge add-index-state into master

Adds support for reproducible package resolution using index-state timestamps, similar to cabal.project's index-state feature.

Schema Changes

HaskellSource type:

  • Replace FromHackage with FromIndex { index : Text, name : Text, version : Version }
  • The index field contains repository base URL (e.g., "https://hackage.haskell.org")

New types:

  • IndexState = List { index : Text, timestamp : Text }
  • ExportSettings base type with packagesDir and indexState fields

Export settings:

  • PackageSetExportSettings: Now extends ExportSettings (includes indexState field)
  • OverlayExportSettings: Now extends ExportSettings (includes indexState field)

New Helper Functions

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.gz to the URL
  • Optional indexState configuration 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.

Edited by Horizon Bot

Merge request reports