SHARE
TWEET

Untitled

a guest Apr 24th, 2019 119 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. { pkgs ?
  2.  
  3. import (builtins.fetchTarball {
  4.   url = "https://github.com/NixOS/nixpkgs/archive/b936b2ddac91901df1daa8393617e74f678236c5.tar.gz";
  5.   # Hash obtained using `nix-prefetch-url --unpack <url>`
  6.   sha256 = "0vrhldxlwqz467mn9dxhpzjgxvw5zjwwa2k3iyly2jhan0h2brac";
  7. }) {} ,
  8.  
  9.  
  10.  
  11. pythonPackages ? pkgs.python37Packages }:
  12.  
  13. let
  14.   patch =
  15.         { meta.description = "jupyterlab";
  16.           url = "https://github.com/jupyterlab/jupyterlab/commit/3b8d451e6f9a4c609e60cde5fbb3cc84aae79951.patch";
  17.           #sha256 = "0mxf8csah6yx66q37va668wikibcnzclppf73aww7h9i3n7lx2zz";
  18.         };
  19. in
  20.  
  21. pkgs.mkShell rec {
  22.   buildInputs = [
  23.     ### Base Packages
  24.  
  25.     (pythonPackages.ipykernel.overrideDerivation (z: { doCheck=false; doInstallCheck = false; checkPhase = ""; } ))
  26.     (pythonPackages.jupyterlab.overrideDerivation (z: { doCheck=false; doInstallCheck = false; checkPhase = ""; } ))
  27.  
  28.  
  29.  
  30.     (pythonPackages.matplotlib.overrideDerivation (z: { doCheck=false; doInstallCheck = false; checkPhase = ""; } ))
  31.     (pythonPackages.numpy.overrideDerivation (z: { doCheck=false; doInstallCheck = false; checkPhase = ""; } ))
  32.     #(pythonPackages.scipy.overrideDerivation (z: { doCheck=false; doInstallCheck = false; checkPhase = ""; } ))
  33.  
  34.     (pythonPackages.graphviz.overrideDerivation (z: { doCheck=false; doInstallCheck = false; checkPhase = ""; } ))
  35.     (pythonPackages.cypari2.overrideDerivation (z: { doCheck=false; doInstallCheck = false; checkPhase = ""; } ))
  36.   ];
  37.  
  38.  
  39.   patches = [
  40.     (fetchpatch patch) ];
  41.  
  42.   shellHook = ''
  43.     TEMPDIR=$(mktemp -d -p /tmp)
  44.     mkdir -p $TEMPDIR
  45.     cp -r ${pythonPackages.jupyterlab}/share/jupyter/lab/* $TEMPDIR
  46.     chmod -R 755 $TEMPDIR
  47.     echo "$TEMPDIR is the app directory"
  48.  
  49.     # kernels
  50.     export JUPYTER_PATH="${pkgs.lib.concatMapStringsSep ":" (p: "${p}/share/jupyter/") []}"
  51.  
  52. # start jupyterlab
  53. jupyter lab --app-dir=$TEMPDIR
  54.   '';
  55.  
  56. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top