Skip to content

Instantly share code, notes, and snippets.

Created June 23, 2020 08:18
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save domenkozar/42311c302da74c10089a8ac28afd7bbc to your computer and use it in GitHub Desktop.
Save domenkozar/42311c302da74c10089a8ac28afd7bbc to your computer and use it in GitHub Desktop.
Haskell + GitHub Actions + Cachix
name: "CI"
runs-on: ubuntu-latest
- uses: actions/checkout@v2.3.1
- uses: cachix/install-nix-action@v10
skip_adding_nixpkgs_channel: true
- uses: cachix/cachix-action@v6
name: mycache
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: cachix use iohk
- run: nix-build -A mypackage.components.all
{ haskellNix ? import (builtins.fetchTarball "") {}
, nixpkgsSrc ? haskellNix.sources.nixpkgs-2003
, nixpkgsArgs ? haskellNix.nixpkgsArgs
, pkgs ? import nixpkgsSrc nixpkgsArgs
pkgs.haskell-nix.project {
src = pkgs.haskell-nix.haskellLib.cleanGit {
name = "haskell-nix-project";
src = ./.;
Copy link

This didn't work for me

nix-build -A reanimate.components.all                                                                                                                        ~/p/VisualiseValue/reanimate
trace: To make this a fixed-output derivation but not materialized, set `stack-sha256` to the output of /nix/store/xygihs8zxd7av2md2b9nwg0whjvj24p1-calculateSha
trace: To materialize the output entirely, pass a writable path as the `materialized` argument and pass that path to /nix/store/avg8ski5295yljrgvd8ikqd3217x6c4j-generateMaterialized
error: The Haskell package set does not contain the package: stm (build dependency).
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.

(use '--show-trace' to show detailed location information)

I was trying to add this to an existing project: cdodev/reanimate@e7f7790

Copy link

@commandodev I think that's one of the top issues people hit with GHC core libraries: input-output-hk/haskell.nix#481

Copy link

Ah right - what to do here then? (Sorry - haven't messed around with haskell.nix too much)

Copy link

domenkozar commented Jun 23, 2020

Pass the following to project function:

  modules = [{
    nonReinstallablePkgs =                                                                                                                                                                    
      [ "rts"

With the list of all module options at

Copy link

Ah yep, that seems to work better :-)

Copy link

This is outdated because the iohk cachix cache is no longer updated.

Copy link

Yeah, you need to use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment