3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/tools/haskell/ihaskell/wrapper.nix

24 lines
864 B
Nix
Raw Normal View History

2015-04-15 21:59:07 +01:00
{ stdenv, writeScriptBin, buildEnv, ghcWithPackages, ihaskell, ipython, packages }:
let
ihaskellEnv = ghcWithPackages (self: [
self.ihaskell
self.ihaskell-blaze
self.ihaskell-diagrams
self.ihaskell-display
] ++ packages self);
2015-04-15 21:59:07 +01: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
'';
profile = "${ihaskell.pname}-${ihaskell.version}/profile/profile.tar";
2015-04-15 21:59:07 +01:00
in
buildEnv {
name = "ihaskell-with-packages";
paths = [ ihaskellEnv ipython ];
postBuild = ''
ln -s ${ihaskellSh}/bin/ihaskell-notebook $out/bin/.
'';
}