Skip to content

Instantly share code, notes, and snippets.

@nsaritzky
Created April 6, 2022 15:51
Show Gist options
  • Save nsaritzky/5ddc4e2470bfd2e02fd693379d592187 to your computer and use it in GitHub Desktop.
Save nsaritzky/5ddc4e2470bfd2e02fd693379d592187 to your computer and use it in GitHub Desktop.
Haskell, Nix, and Apple Silicon

GHC has spotty support for aarch64-darwin. Only certain newer versions have native support. As far as I can tell:

The fist two added support for an ARM LLVM backend. 9.2.1 has a native code generator that doesn't rely on LLVM and is apparentiy faster. But issues remain.

  • This bug in Nix distributions of GHC cause problems buiding certain packages, including Niv and Ormolu, the latter of which is a dependency of haskell-language-server. This has been fixed only for 8.10.7. HLS on other versions have failed to build on my machine at great length. Make sure you have the HLS cachix set up and beware cache misses.

I find that [this flake] works provided you set haskellPackages accordingly:

let hp = pkgs.haskell.packages.ghc8107;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment