haskell.nix is a free, open source build & deployment project written in Nix and released under Apache-2.0. It has 634 GitHub stars, 270 forks and 105 open issues, and was last pushed 18 hours ago. On this registry it ranks #75 of 84 tracked projects in Build & Deployment, with 5 head-to-head comparisons available. It gained 2 stars over the last 30 tracked days.

What is haskell.nix?

haskell.nix is alternative Haskell infrastructure for Nixpkgs that automatically translates a Cabal or Stack project and its dependencies into Nix code, aimed at Haskell developers and Nix packagers who need reproducible, cacheable builds across many compilers and platforms.

What it is

haskell.nix is an infrastructure layer that sits on top of Nixpkgs and translates Haskell build descriptions into Nix expressions. It takes a Cabal or Stack project and its dependency set and produces the Nix code needed to build that project, so the project becomes an ordinary derivation that Nix can evaluate, cache, and substitute like anything else.

The concrete problem it solves is the fragile, hand-maintained Nix expression that Haskell projects traditionally need in order to build under Nixpkgs. Instead of pinning compilers, boot libraries, and package versions by hand, a project declares its Cabal or Stack setup and haskell.nix generates the rest. It lives in the Nix ecosystem and replaces manual, project-local Haskell package sets with generated, cache-backed infrastructure. It depends on two sibling repositories, hackage.nix (the contents of the Hackage databases converted to Nix expressions) and stackage.nix (all Stackage snapshots converted to Nix expressions).

Key capabilities

  • Translates Cabal or Stack projects and their dependencies into Nix code automatically.
  • Publishes prebuilt GHCs and boot libraries to two binary caches: cache.iog.io, which only holds the GHC versions currently used by IOG's own projects, and cache.zw3rk.com, which holds all compiler versions tested in CI, including cross-compilers.
  • Cross-compiles across targets that include static, musl64, musl32, aarch64, aarch64-musl, android/aarch64, android/armv7a, javascript, wasm, windows/mingwW64, and windows/ucrt64.
  • Tracks compiler coverage through a generated CI status table built from the latest master builds on ci.zw3rk.com, reporting the roots.ghc job for each compiler and platform across ghc967, ghc984, ghc9103, ghc9124, ghc9141, and ghc9141llvm.
  • Supports the Nixpkgs unstable channel alongside the R2511 release, on x86_64-linux, aarch64-darwin, and x86_64-darwin hosts.
  • Ships documentation covering an introduction, a getting started tutorial, and a troubleshooting guide.

Who uses it and how

  • Haskell teams on Nix who want to stop maintaining their own package sets and instead consume generated Nix expressions from a pinned project description.
  • Projects that must ship to non-Linux targets, using the cross-compilers for Android, Windows (mingwW64, ucrt64), javascript, and wasm.
  • CI-driven setups where the binary cache is configured as a substituter, which the README identifies as the surest way to avoid building GHC from source; cache.zw3rk.com carries every compiler tested in CI, while cache.iog.io carries only IOG's own compiler set.
  • Organisations that need commercial support, for which the README lists the contact devx@iohk.io.

Getting started

The README points to the Getting Started tutorial at https://input-output-hk.github.io/haskell.nix/tutorials/getting-started, which covers setting up the binary cache. The provided excerpt names no package, Docker image, or compose file, so that tutorial and its binary cache configuration are the documented entry point.

How it compares

The facts provided name no comparable tools and no list of paid products that haskell.nix replaces, so it stands alone in this registry. No licence, self-hosting, data-ownership, or cost comparison against other products can be drawn from the supplied material.

When to use it — and when not to

A self-hoster takes on operating Nix plus binary cache substituters, and a misconfigured cache means building GHC from source, which the README calls the number one problem users hit. Teams that want to avoid the Nix ecosystem entirely, or that need a Docker-first or non-Nix build workflow, should not pick it. The repository carries 105 open issues, and the CI table shows gaps, including an entirely unbuilt x86_64-darwin row and no built cells for R2511, so coverage is uneven despite the recent push activity.

project readme (upstream, from github) — read inline

haskell.nix is infrastructure for building Haskell packages with Nix

haskell.nix can automatically translate your Cabal or Stack project and its dependencies into Nix code.

Documentation

Help! Something isn't working

The #1 problem that people have when using haskell.nix is that they find themselves building GHC. This should not happen, but you must follow the haskell.nix setup instructions properly to avoid it. If you find this happening to you, please check that you have followed the getting started instructions and consult the corresponding troubleshooting section.

The troubleshooting documentation also contains some help for other common issues. If you're still stuck open an issue.

Compiler CI status

haskell.nix publishes prebuilt GHCs (and boot libraries) to two binary caches:

  • cache.iog.io only holds the GHC versions currently in use by IOG's own projects, so it does not cover every compiler haskell.nix supports.
  • cache.zw3rk.com holds all the compiler versions currently tested in haskell.nix CI — including cross-compilers — so configuring it as an extra substituter is the surest way to avoid building GHC yourself.

The table below is generated automatically from the latest master builds on ci.zw3rk.com and shows the build status of GHC itself (the roots.ghc job) for each compiler and platform. A ✅ means that compiler/platform is built and cached for the current master (a build only counts once it is part of the latest evaluation, so a green never reflects a stale build).

Legend: ✅ built & cached · ⚠️ dependency failed · ❌ failed · ⚪ aborted/cancelled · 🕓 building

Nixpkgs Host → Target ghc967 ghc984 ghc9103 ghc9124 ghc9141 ghc9141llvm
unstable x86_64-linux ✅ ✅ ✅ ✅ ✅ ✅
unstable x86_64-linux → static ✅ ✅ ✅ ✅ ✅ ·
unstable x86_64-linux → musl64 ✅ ✅ ✅ ✅ ✅ ✅
unstable x86_64-linux → musl32 ✅ ✅ ✅ ✅ ✅ ·
unstable x86_64-linux → aarch64 ✅ ✅ ✅ ✅ ✅ ✅
unstable x86_64-linux → aarch64-musl ✅ ✅ ✅ ✅ ✅ ✅
unstable x86_64-linux → android/aarch64 · · · ✅ ✅ ✅
unstable x86_64-linux → android/armv7a · · · ✅ ✅ ✅
unstable x86_64-linux → javascript ✅ ✅ · ✅ ✅ ·
unstable x86_64-linux → wasm · · · ✅ ✅ ·
unstable x86_64-linux → windows/mingwW64 ✅ ✅ ✅ ✅ ✅ ·
unstable x86_64-linux → windows/ucrt64 ✅ ✅ ✅ ✅ ✅ ·
unstable aarch64-darwin ✅ ✅ ✅ ✅ ✅ ✅
unstable aarch64-darwin → javascript ✅ ✅ · ✅ ✅ ·
unstable aarch64-darwin → wasm · · · ✅ ✅ ·
unstable x86_64-darwin · · · · · ·
unstable x86_64-darwin → javascript · · · · · ·
R2511 x86_64-linux · · · · · ·
R2511 aarch64-darwin · · · · · ·
R2511 x86_64-darwin · · · · · ·

Related repos

The haskell.nix repository contains the runtime system for building Haskell packages in Nix. It depends on other repos, which are:

[!NOTE] For commercial support, please don't hesitate to reach out at devx@iohk.io

Frequently asked questions

Is haskell.nix free to use?

haskell.nix is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does haskell.nix do?

Alternative Haskell Infrastructure for Nixpkgs

What is haskell.nix written in?

haskell.nix is primarily written in Nix. Its source is publicly available at https://github.com/input-output-hk/haskell.nix, and it has 634 GitHub stars.