Install elm 0.16 on nixos

Last I checked elm had made it into nixpkgs (at least in unstable), but its only at 0.14.  With the flurry of blog posts lately about 0.16, 0.14 is not going to cut it!  Luckily installing 0.16 is pretty easy (except for the shell.nix perhaps):

> cd <where I keep code>
> mkdir elmthings
> cd elmthings

Then (just like with 0.15.1), make an shell.nix file that looks like this:

nixpkgs ? import  {}, compiler ? "ghc7102" }:
  inherit (nixpkgs) pkgs;
  cabal = pkgs.haskell.packages.${compiler}.cabal-install;
  ghc = pkgs.haskell.packages.${compiler}.ghcWithPackages (ps: with ps; [
          monad-par mtl
pkgs.stdenv.mkDerivation {
  name = "my-haskell-env-0";
  buildInputs = [ ghc cabal pkgs.zlib ];
  shellHook = "eval $(egrep ^export ${ghc}/bin/ghc)";

Then its just following the directions from the elm site:

[pr06lefs@nixosthe1:~/code/elmthings]$ nix-shell
[nix-shell:~/code/elmthings]$ curl > BuildFromSource.hs
[nix-shell:~/code/elmthings]$ runhaskell BuildFromSource.hs 0.16

If all goes well, the executables end up in the following directory. This directory should be added to your path.


[nix-shell:~/code/elmthings/Elm-Platform/0.16/.cabal-sandbox/bin]$ ls
aeson-pretty elm elm-make elm-package elm-reactor elm-repl glsl-pprint


One thought on “Install elm 0.16 on nixos

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s