This repo contains build code and tools shared between IOHK projects.
- Pinned versions of input-output-hk/nixpkgs.
- Haskell.nix and
nix-tools
, plus package overlays and patches for cross-compiling to Windows. - Scripts for regenerating code with
nix-tools
. - Util functions such as source filtering.
- Nix builds of development tools such as HLint, ShellCheck, Stylish Haskell, SHC, cache-s3.
- Nix packages and overlay for the rust-cardano projects.
- A skeleton project demonstrating how to use iohk-nix and set up CI.
niv update iohk-nix
Some things may have changed which could break your build, so refer to the ChangeLog.
Look in the "User Guide" section of the Haskell.nix Documentation.
If you have updated your project's Stackage LTS
version, then you may need to update the iohk-nix
revision in your
project. The error message you may see is:
error: This version of stackage.nix does not know
about the Stackage resolver X.Y.
You may need to update haskell.nix to one
that includes a newer stackage.nix.
If updating the LTS, the compiler version may also have been
increased. Note that we maintain a patched GHC for cross-compiling to
Windows. The GHC version that you use needs to be supported by
iohk-nix
. The error message in this case will be:
error: This version of Nixpkgs does not contain GHC x.y.z
In both of these cases, update the iohk-nix
revision to the latest
available using the instructions above.
To add support for a new GHC version in iohk-nix
, first update its
Nixpkgs version to one that provides that compiler, then work on
adding the version to nix-tools-iohk-extras.nix
.
The docs folder contains a list of typical Nix errors encountered while developing with Haskell and Nix. The hope is developers will add Nix related problems they've encountered and solved to this folder.
- Gotcha 1 - attribute
unbuildable
missing (win32/unix dependency issues) - Gotcha 2 - more help with build problems
- Gotcha 3 - filtering sources
- Gotcha 4 - overriding version pins
- Gotcha 5 - ghci
- Gotcha 6 - how to get longer error messages from
nix build
Please document any change that might affect project builds in the ChangeLog. For example:
- Bumping
nixpkgs
to a different branch. - Changing API (renaming attributes, changing function parameters, etc).
- Bumping the
haskell.nix
version.
Also update the skeleton
project if necessary.