Problem building with Haskell.nix

As per instructions, cc’ing @domenkozar @grahamc.

IOHK’s Haskell.nix is nice, because it’s can delegate dependency version resolution to Cabal, rather than rely on versions being pinned in a commit of Nixpkgs.

Haskell build times can be long, so I thought it would be nice to build some projects in Travis and then cache them to Cachix. For the normal Nixpkgs builds, this worked fine. But all the projects that used Haskell.nix failed on Travis with the following sort of error:

moving build output ‘/nix/store/9r1d1vzc8r4cqh06d8f9q0arc8xh93m8-codex-plan-to-nix-pkgs’ from the sandbox to the Nix store: Permission denied

You can see an example Travis build for more details of error. This is job is building shajra/shajra-nix-packages@a7025480.

Everything builds fine for me on NixOS. I’m not as familiar with the Travis image used for Nix, so not sure how better to debug this.