Skip to content

Releases: nh2/nixpkgs

GHC built with musl via nix

12 Jun 22:50
@nh2 nh2
Compare
Choose a tag to compare
Pre-release

Contained here is a build of GHC with musl via nix.

Essentially it allows you to run the command to build a small example program as described in NixOS#37598 (comment), but importing the below nix closure I've pre-compiled allows you to skip 2 compilations of GHC.

curl https://github.com/nh2/nixpkgs/releases/download/ghc-cross-musl-works/ghc-musl.closure.xz | xz -d | nix-store --import

Then run the command from NixOS#37598 (comment) again to build the example program.


The GHC built this way is the one built by the command in the linked comment (branch name replaced by SHA at that time):

NIX_PATH=nixpkgs=https://github.com/dtzWill/nixpkgs/archive/7048fc71e325c69ddfa62309c0b661b430774eac.tar.gz nix-build '<nixpkgs>' --arg crossSystem '{config="x86_64-unknown-linux-musl";}' -A haskell.packages.ghc841.hello 

Note it's a bit confusing that this is filed under the tag ghc-cross-musl-works when in fact it uses branch feature/ghc-cross-musl. My mistake; whatever, it's just naming.