Entering the development shell using ~nix-shell~ will pull
in all the dependencies required by all sub-packages.
Both ~default.nix~ and ~shell.nix~ simply import ~<nixpkgs>~ from your
~NIX_PATH~. If this is by chance broken, try using ~nixpkgs-unstable~ which
is targeted by our CI, as it is also the basis for ~haskell-updates~~nixpkgs~ branch
where new Hackage packages land.
Not pinning the to specific version of ~nixpkgs~ is intentional so CI can roll
with the ~unstable~ branch and detect breakage early.
** Using another version of GHC
To use a different version of GHC to the one used
by your ~pkgs.haskellPackages~, pass, for example ~--argstr compiler ghc963~
to either ~nix-shell~ or ~nix-build~
** ~matrix.nix~
~nix-build matrix-nix~ can be used to check that all our packages
built against all supported GHC versions. It pulls the versions
from [[../.github/workflows/ci.dhall][.github/workflows/ci.dhall]] so there is a single source of truth
and the compilers don't need to be listed separately again.
* Adding new packages
When adding a new sub-package, following files need to be updated:
+ ~default.nix~
+ ~shell.nix~
+ ~cabal.project~
+ ~cabal.project.local.ci~ (only if needed)
+ ~hie.yaml~
* CI
The GitHub Actions CI uses [[https://github.com/sorki/github-actions-dhall][github-actions-dhall]] and [[../.github/workflows/ci.dhall][.github/workflows/ci.dhall]]
to generate the [[../.github/workflows/ci.yaml][.github/workflows/ci.yaml]] workflow file
which does a full matrix build of supported compilers both using ~cabal~ and ~nix~.
** Cachix cache
The CI uses [[https://github.com/cachix/cachix/][cachix]] to not rebuild everything from scratch everytime it runs, it also
feeds the cache available at https://app.cachix.org/cache/hnix-store which you
can configure on your system.
** Updating
To update the CI, edit [[../.github/workflows/ci.dhall][.github/workflows/ci.dhall]] and run [[../.github/workflows/ci.sh][.github/workflows/ci.sh]]
to regenerate the ~yaml~ file. Don't forget to commit both files.