mirror of
https://github.com/IHaskell/IHaskell.git
synced 2025-04-17 20:06:07 +00:00
Move to jupyter-lab.
Moves package from using jupyter-notebook to the jupyter-lab. Both backends can still be used using: ihaskell-notebook and ihaskell-lab respectively.
This commit is contained in:
parent
bf631b913f
commit
a87ea7b019
11
release.nix
11
release.nix
@ -49,25 +49,26 @@ let
|
||||
zeromq4-haskell = nixpkgs.haskell.lib.dontCheck super.zeromq4-haskell;
|
||||
} // displays self);
|
||||
ihaskellEnv = haskellPackages.ghcWithPackages (self: [ self.ihaskell ] ++ packages self);
|
||||
notebook = nixpkgs.python3.withPackages (ps: [ ps.notebook ] ++ pythonPackages ps);
|
||||
jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ] ++ pythonPackages ps);
|
||||
ihaskellSh = cmd: extraArgs: nixpkgs.writeScriptBin "ihaskell-${cmd}" ''
|
||||
#! ${nixpkgs.stdenv.shell}
|
||||
export GHC_PACKAGE_PATH="$(echo ${ihaskellEnv}/lib/*/package.conf.d| tr ' ' ':'):$GHC_PACKAGE_PATH"
|
||||
export PATH="${nixpkgs.stdenv.lib.makeBinPath ([ ihaskellEnv notebook ] ++ systemPackages nixpkgs)}:$PATH"
|
||||
${ihaskellEnv}/bin/ihaskell install -l $(${ihaskellEnv}/bin/ghc --print-libdir) --use-rtsopts="${rtsopts}" && ${notebook}/bin/jupyter ${cmd} ${extraArgs} "$@"
|
||||
export PATH="${nixpkgs.stdenv.lib.makeBinPath ([ ihaskellEnv jupyterlab ] ++ systemPackages nixpkgs)}:$PATH"
|
||||
${ihaskellEnv}/bin/ihaskell install -l $(${ihaskellEnv}/bin/ghc --print-libdir) --use-rtsopts="${rtsopts}" && ${jupyterlab}/bin/jupyter ${cmd} ${extraArgs} "$@"
|
||||
'';
|
||||
in
|
||||
nixpkgs.buildEnv {
|
||||
name = "ihaskell-with-packages";
|
||||
buildInputs = [ nixpkgs.makeWrapper ];
|
||||
paths = [ ihaskellEnv notebook ];
|
||||
paths = [ ihaskellEnv jupyterlab ];
|
||||
postBuild = ''
|
||||
ln -s ${ihaskellSh "lab" ""}/bin/ihaskell-lab $out/bin/
|
||||
ln -s ${ihaskellSh "notebook" ""}/bin/ihaskell-notebook $out/bin/
|
||||
ln -s ${ihaskellSh "nbconvert" ""}/bin/ihaskell-nbconvert $out/bin/
|
||||
ln -s ${ihaskellSh "console" "--kernel=haskell"}/bin/ihaskell-console $out/bin/
|
||||
for prg in $out/bin"/"*;do
|
||||
if [[ -f $prg && -x $prg ]]; then
|
||||
wrapProgram $prg --set PYTHONPATH "$(echo ${notebook}/lib/*/site-packages)"
|
||||
wrapProgram $prg --set PYTHONPATH "$(echo ${jupyterlab}/lib/*/site-packages)"
|
||||
fi
|
||||
done
|
||||
'';
|
||||
|
Loading…
x
Reference in New Issue
Block a user