Add support for jupyterlabAppDir

This commit is contained in:
Vaibhav Sagar 2019-11-23 13:05:50 -05:00
parent aee398a82f
commit 50ec34316b
3 changed files with 9 additions and 3 deletions

View File

@ -1,8 +1,9 @@
{ compiler ? "ghc865"
, jupyterlabAppDir ? null
, nixpkgs ? import <nixpkgs> {}
, packages ? (_: [])
, pythonPackages ? (_: [])
, rtsopts ? "-M3g -N2"
, systemPackages ? (_: [])
}:
import (./release.nix) { inherit compiler nixpkgs packages pythonPackages rtsopts systemPackages; }
import (./release.nix) { inherit compiler jupyterlabAppDir nixpkgs packages pythonPackages rtsopts systemPackages; }

View File

@ -1,8 +1,9 @@
{ compiler ? "ghc881"
, jupyterlabAppDir ? null
, nixpkgs ? import <nixpkgs> {}
, packages ? (_: [])
, pythonPackages ? (_: [])
, rtsopts ? "-M3g -N2"
, systemPackages ? (_: [])
}:
import (./release.nix) { inherit compiler nixpkgs packages pythonPackages rtsopts systemPackages; }
import (./release.nix) { inherit compiler jupyterlabAppDir nixpkgs packages pythonPackages rtsopts systemPackages; }

View File

@ -1,4 +1,5 @@
{ compiler
, jupyterlabAppDir ? null
, nixpkgs ? import <nixpkgs> {}
, packages ? (_: [])
, pythonPackages ? (_: [])
@ -69,13 +70,16 @@ let
--use-rtsopts="${rtsopts}" \
&& ${jupyterlab}/bin/jupyter ${cmd} ${extraArgs} "$@"
'';
appDir = if jupyterlabAppDir != null
then "--app-dir=${jupyterlabAppDir}"
else "";
in
nixpkgs.buildEnv {
name = "ihaskell-with-packages";
buildInputs = [ nixpkgs.makeWrapper ];
paths = [ ihaskellEnv jupyterlab ];
postBuild = ''
ln -s ${ihaskellJupyterCmdSh "lab" ""}/bin/ihaskell-lab $out/bin/
ln -s ${ihaskellJupyterCmdSh "lab" appDir}/bin/ihaskell-lab $out/bin/
ln -s ${ihaskellJupyterCmdSh "notebook" ""}/bin/ihaskell-notebook $out/bin/
ln -s ${ihaskellJupyterCmdSh "nbconvert" ""}/bin/ihaskell-nbconvert $out/bin/
ln -s ${ihaskellJupyterCmdSh "console" "--kernel=haskell"}/bin/ihaskell-console $out/bin/