Jerry-rigging GHCup on NixOS?

We have built something somewhat related with our devx shell. It used haskell.nix to get the compilers, cabal, hls (and some other tools); and is cached on cache.zw3rk.com.

You can use them with

nix develop github:input-output-hk/devx#ghc8107 --no-write-lock-file --refresh

which provide a shell with ghc, cabal, hls, hlint, …

There is also a guide on how to use it with direnv, and make it work with VSCode, emacs, and vim.

There is also a note on getting DevContainer/CodeSpaces to work.

We’ve also got a corresponding speed-optimised GitHub Action, which we use in ci to test the various combinations we have to build the hello package.

As this builds on the logic in haskell.nix, we can do (limited) cross compilation (e.g. to windows), and static targets. However I will note that there may still be residual bugs.

Maybe this is helpful to someone.

8 Likes