Cached Haskell IDE Engine Nix builds for all GHC versions
Go to file
Silvan Mosberger ee90971d41
Add nix to stack2nix's runtime deps
Calls nix-build when updating
2019-05-06 18:30:44 +02:00
generated Use nixpkgs versions for 821, 822 and 843 that work on darwin 2019-05-04 00:13:59 +02:00
nixpkgsForGhc Use nixpkgs versions for 821, 822 and 843 that work on darwin 2019-05-04 00:13:59 +02:00
overrides Patch ghc821 to make it work on Darwin 2019-05-04 00:14:37 +02:00
.envrc Add .cabal file, proper nix-build 2019-05-06 18:12:26 +02:00
.gitattributes Fix linguist to exclude generated files from the stats 2019-04-12 18:37:57 +02:00
.gitignore Add .cabal file, proper nix-build 2019-05-06 18:12:26 +02:00
all-hies.cabal Add .cabal file, proper nix-build 2019-05-06 18:12:26 +02:00
check-cache.sh Add script for checking the cache 2019-05-04 02:35:02 +02:00
default.nix Fix infinite process recursion when no matching version found 2019-05-01 18:42:05 +02:00
Design.org Update design doc 2019-04-26 16:53:34 +02:00
nixpkgs.nix update.hs: Small improvements; use shell.nix file 2019-04-10 02:54:11 +02:00
Readme.org Add .cabal file, proper nix-build 2019-05-06 18:12:26 +02:00
shell.nix Add .cabal file, proper nix-build 2019-05-06 18:12:26 +02:00
update.hs Add .cabal file, proper nix-build 2019-05-06 18:12:26 +02:00
update.nix Add nix to stack2nix's runtime deps 2019-05-06 18:30:44 +02:00

Cached Haskell IDE Engine Nix builds for all GHC versions

This repository provides cached Nix builds for the latest stable Haskell IDE Engine (HIE) for all supported GHC versions. It is intended to be a successor to hie-nix, which only provides a changing subset of versions. This project solves the problem of having mismatched HIE and project GHC versions, which is almost impossible to avoid if you use a globally installed HIE and have many projects.

Installation

Cached builds

If you wish to use prebuilt binaries, available on both Linux and macOS, configure the all-hies cache with these instructions, or if you have cachix installed already:

cachix use all-hies

NixOS installation

Add this to the start of your configuration.nix:

  let
    all-hies = import (fetchTarball "https://github.com/infinisil/all-hies/tarball/master") {};
  in
  {
    # ...
  }

Then depending on your needs, add the versions you need to environment.systemPackages:

For the latest supported GHC version only (which is 8.6.4 right now):

  {
    environment.systemPackages = [ all-hies.latest ];
  }

For a specific version of GHC (warning: If you need multiple versions, use the approach after this one instead):

  {
    environment.systemPackages = [ all-hies.versions.ghc864 ];
  }

For a specific set of GHC versions (note: The hie / hie-wrapper binaries will both be a HIE wrapper that chooses the correct version out of the given ones):

   {
     environment.systemPackages = [
       (all-hies.selection { selector = p: { inherit (p) ghc864 ghc863 ghc843; }; })
     ];
   }

For all supported GHC versions (warning: requires ~30GB (or <10GB with compression) of space for all 9 versions):

  {
    environment.systemPackages = [
      (all-hies.selection { selector = p: p; })
    ];
  }

nix-env installation

For the latest supported GHC version only (which is 8.6.4 right now):

  nix-env -iA latest -f https://github.com/infinisil/all-hies/tarball/master

For a specific version of GHC (warning: If you need multiple versions, use the approach after this one instead):

  nix-env -iA versions.ghc864 -f https://github.com/infinisil/all-hies/tarball/master

For a specific set of GHC versions (note: The hie / hie-wrapper binaries will both be a HIE wrapper that chooses the correct version out of the given ones):

  nix-env -iA selection --arg selector 'p: { inherit (p) ghc864 ghc863 ghc843; }' -f https://github.com/infinisil/all-hies/tarball/master

For all supported GHC versions (warning: requires ~30GB (or <10GB with compression) of space for all 9 versions):

  nix-env -iA selection --arg selector 'p: p' -f https://github.com/infinisil/all-hies/tarball/master

Updating this repository

If a new stable HIE version has been released, the following commands can be used to update the repository with it and build all versions

  nix-build update.nix
  result/bin/update
  nix-build -A versions -k

This will take a long time, but both of these commands do a lot of intermediate caching and are idempotent, so they can be interrupted and resumed at any time. If builds fail for some reason, the overrides directory can be used to add GHC-specific Haskell overrides.

Depending on the amount of RAM you have, the above nix-build command can lead to a lot of thrashing, because Nix interleaves all dependencies from all different GHC versions, which means its working memory is about $number-of-versions * $size-of-ghc. To avoid this, build each version in a series of commands instead (or only k versions at a time). Because there's a lot of dependencies, you might also want to use `max-jobs auto cores 1`, in order to approximate maximal processor usage and minimize build time.