1 { lib, stdenv, writeScriptBin, makeWrapper, buildEnv, haskell, ghcWithPackages, jupyter, packages }:
3 ihaskellEnv = ghcWithPackages (self: [
6 # Doesn't work with latest ihaskell versions missing an unrelated change
7 # https://github.com/IHaskell/IHaskell/issues/1378
8 # self.ihaskell-diagrams
10 ihaskellSh = writeScriptBin "ihaskell-notebook" ''
12 export GHC_PACKAGE_PATH="$(echo ${ihaskellEnv}/lib/*/package.conf.d| tr ' ' ':'):$GHC_PACKAGE_PATH"
13 export PATH="${lib.makeBinPath ([ ihaskellEnv jupyter ])}''${PATH:+:}$PATH"
14 ${ihaskellEnv}/bin/ihaskell install -l $(${ihaskellEnv}/bin/ghc --print-libdir) && ${jupyter}/bin/jupyter notebook
18 name = "ihaskell-with-packages";
19 nativeBuildInputs = [ makeWrapper ];
20 paths = [ ihaskellEnv jupyter ];
22 ln -s ${ihaskellSh}/bin/ihaskell-notebook $out/bin/
23 for prg in $out/bin"/"*;do
24 if [[ -f $prg && -x $prg ]]; then
25 wrapProgram $prg --set PYTHONPATH "$(echo ${jupyter}/lib/*/site-packages)"