๐Ÿ“ฆ juspay / haskell-incremental-build-template

A template for incremental Haskell builds using Nix

โ˜… 2 stars โ‘‚ 2 forks ๐Ÿ‘ 2 watching โš–๏ธ MIT License
๐Ÿ“ฅ Clone https://github.com/juspay/haskell-incremental-build-template.git
HTTPS git clone https://github.com/juspay/haskell-incremental-build-template.git
SSH git clone git@github.com:juspay/haskell-incremental-build-template.git
CLI gh repo clone juspay/haskell-incremental-build-template
shivaraj-bh shivaraj-bh readme: highlight the GHC version requirement d406e4a 8 months ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .github
๐Ÿ“ nix
๐Ÿ“ src
๐Ÿ“„ .envrc
๐Ÿ“„ .gitattributes
๐Ÿ“„ .gitignore
๐Ÿ“„ flake.lock
๐Ÿ“„ flake.nix
๐Ÿ“„ LICENSE
๐Ÿ“„ README.md
๐Ÿ“„ README.md

haskell-incremental-build-template

[!IMPORTANT]
This minimal template focuses solely on incremental Haskell build configuration with Nix.
For a more batteries-included Haskell Nix template, combine it with
[!IMPORTANT]
Requires GHC >= 9.4

A template for incremental Haskell builds using Nix, leveraging nixpkgsโ€™s Haskell incremental build system and [haskell-flake]

Getting Started

For an existing Haskell project already using [haskell-flake], integrate this template by:

https://github.com/juspay/haskell-incremental-build-template/blob/7432331400f27924d827fbf81de5140c1fa0052c/flake.nix#L10-L14

https://github.com/juspay/haskell-incremental-build-template/blob/7432331400f27924d827fbf81de5140c1fa0052c/nix/modules/flake/haskell.nix#L20-L32

https://github.com/juspay/haskell-incremental-build-template/blob/efd179a97b078634db3f124e862260d3acc35499/.github/workflows/ci.yaml#L30-L48

Quick Trial

  • Clone the repository: git clone https://github.com/juspay/haskell-incremental-build-template && cd haskell-incremental-build-template
  • Perform a full build: nix build .#default -L
  • This builds both Example.hs and Main.hs modules.
  • Add a newline to Main.hs to simulate a change: echo >> src/Main.hs
  • Perform an incremental build: nix build .#default --override-input prev github:juspay/haskell-incremental-build-template -L
  • Only Main.hs is rebuilt.