Closed harris-chris closed 3 years ago
Hmm, I haven't tried it but how about something like this?
diff --git a/templates/default.nix b/templates/default.nix
index c4fb31c..9c23200 100644
--- a/templates/default.nix
+++ b/templates/default.nix
@@ -14,6 +14,8 @@ let
# add it here.
extraLibs = [];
+ python = python3.withPackages (ps: [ ps.jupyter ps.notebook ]);
+
# Wrapped Julia with libraries and environment variables.
# Note: setting The PYTHON environment variable is recommended to prevent packages
# from trying to obtain their own with Conda.
@@ -21,7 +23,7 @@ let
mkdir -p $out/bin
makeWrapper ${baseJulia}/bin/julia $out/bin/julia \
--suffix LD_LIBRARY_PATH : "${lib.makeLibraryPath extraLibs}" \
- --set PYTHON ${python3}/bin/python
+ --set PYTHON ${python}/bin/python
'';
in
Thanks, Thomas. That doesn't seem to work as-is. The crucial bit seems to be in https://github.com/JuliaLang/IJulia.jl/blob/master/src/jupyter.jl - the find_jupyter_subcommand
function seems to have a series of fallbacks on where to look for Jupyter. It's late evening here but I'll have a look at it tomorrow and see if I can figure it out.
Oh, it looks like it's looking for it on the PATH
-- how about this addition:
diff --git a/templates/default.nix b/templates/default.nix
index c4fb31c..cb39e41 100644
--- a/templates/default.nix
+++ b/templates/default.nix
@@ -14,6 +14,8 @@ let
# add it here.
extraLibs = [];
+ python = python3.withPackages (ps: [ ps.jupyter ps.notebook ]);
+
# Wrapped Julia with libraries and environment variables.
# Note: setting The PYTHON environment variable is recommended to prevent packages
# from trying to obtain their own with Conda.
@@ -21,7 +23,8 @@ let
mkdir -p $out/bin
makeWrapper ${baseJulia}/bin/julia $out/bin/julia \
--suffix LD_LIBRARY_PATH : "${lib.makeLibraryPath extraLibs}" \
- --set PYTHON ${python3}/bin/python
+ --suffix PATH : "${python}/bin" \
+ --set PYTHON ${python}/bin/python
'';
in
Thanks - that actually works great and is kind of a game-changer for me with Julia and Nix (previously I have been running it in a docker container).
Hello - it seems like this is an issue that's possibly been solved already, but I can't get this to work with Jupyter. If I add IJulia to my Project.toml, run julia2nix, then start Julia (with the appropriate build, so as per the instructions), then
It seems like I may need to add Jupyter as a build input to my
default.nix
or one of the other nix files, so that Conda doesn't try to build it in my home directory, but I'm not proficient enough to figure out exactly where.Thanks!