2015-04-15 22:59:07 +02:00
|
|
|
{ stdenv, writeScriptBin, buildEnv, ghcWithPackages, ihaskell, ipython, packages }:
|
2015-04-11 00:09:31 +02:00
|
|
|
let
|
|
|
|
ihaskellEnv = ghcWithPackages (self: [
|
|
|
|
self.ihaskell
|
|
|
|
self.ihaskell-blaze
|
|
|
|
self.ihaskell-diagrams
|
|
|
|
self.ihaskell-display
|
|
|
|
] ++ packages self);
|
2015-04-15 22:59:07 +02:00
|
|
|
ihaskellSh = writeScriptBin "ihaskell-notebook" ''
|
|
|
|
#!/bin/sh
|
|
|
|
export GHC_PACKAGE_PATH="$(echo ${ihaskellEnv}/lib/*/package.conf.d| tr ' ' ':'):$GHC_PACKAGE_PATH"
|
|
|
|
export PATH="${ihaskell}/bin:${ihaskellEnv}/bin:${ipython}/bin"
|
|
|
|
${ihaskell}/bin/ihaskell install -l $(${ihaskellEnv}/bin/ghc --print-libdir) && ${ipython}/bin/ipython notebook --kernel=haskell
|
|
|
|
'';
|
2015-04-11 00:09:31 +02:00
|
|
|
profile = "${ihaskell.pname}-${ihaskell.version}/profile/profile.tar";
|
2015-04-15 22:59:07 +02:00
|
|
|
in
|
|
|
|
buildEnv {
|
|
|
|
name = "ihaskell-with-packages";
|
|
|
|
paths = [ ihaskellEnv ipython ];
|
|
|
|
postBuild = ''
|
|
|
|
ln -s ${ihaskellSh}/bin/ihaskell-notebook $out/bin/.
|
|
|
|
'';
|
|
|
|
}
|