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" }:
let
  inherit (nixpkgs) pkgs;
  cabal = pkgs.haskell.packages.${compiler}.cabal-install;
  ghc = pkgs.haskell.packages.${compiler}.ghcWithPackages (ps: with ps; [
          monad-par mtl
        ]);
in
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 https://raw.githubusercontent.com/elm-lang/elm-platform/master/installers/BuildFromSource.hs > 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

Advertisements

One thought on “Install elm 0.16 on nixos

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s