Merge pull request #91895 from kristoff3r/jupyter-service
Improve jupyter service
This commit is contained in:
commit
3d9c143b77
@ -6,10 +6,7 @@ let
|
|||||||
|
|
||||||
cfg = config.services.jupyter;
|
cfg = config.services.jupyter;
|
||||||
|
|
||||||
# NOTE: We don't use top-level jupyter because we don't
|
package = cfg.package;
|
||||||
# want to pass in JUPYTER_PATH but use .environment instead,
|
|
||||||
# saving a rebuild.
|
|
||||||
package = pkgs.python3.pkgs.notebook;
|
|
||||||
|
|
||||||
kernels = (pkgs.jupyter-kernel.create {
|
kernels = (pkgs.jupyter-kernel.create {
|
||||||
definitions = if cfg.kernels != null
|
definitions = if cfg.kernels != null
|
||||||
@ -37,6 +34,27 @@ in {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
# NOTE: We don't use top-level jupyter because we don't
|
||||||
|
# want to pass in JUPYTER_PATH but use .environment instead,
|
||||||
|
# saving a rebuild.
|
||||||
|
default = pkgs.python3.pkgs.notebook;
|
||||||
|
description = ''
|
||||||
|
Jupyter package to use.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
command = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "jupyter-notebook";
|
||||||
|
example = "jupyter-lab";
|
||||||
|
description = ''
|
||||||
|
Which command the service runs. Note that not all jupyter packages
|
||||||
|
have all commands, e.g. jupyter-lab isn't present in the default package.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
port = mkOption {
|
port = mkOption {
|
||||||
type = types.int;
|
type = types.int;
|
||||||
default = 8888;
|
default = 8888;
|
||||||
@ -157,7 +175,7 @@ in {
|
|||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
ExecStart = ''${package}/bin/jupyter-notebook \
|
ExecStart = ''${package}/bin/${cfg.command} \
|
||||||
--no-browser \
|
--no-browser \
|
||||||
--ip=${cfg.ip} \
|
--ip=${cfg.ip} \
|
||||||
--port=${toString cfg.port} --port-retries 0 \
|
--port=${toString cfg.port} --port-retries 0 \
|
||||||
|
@ -17,6 +17,7 @@ rustPlatform.buildRustPackage rec {
|
|||||||
buildInputs = stdenv.lib.optional stdenv.isDarwin Security;
|
buildInputs = stdenv.lib.optional stdenv.isDarwin Security;
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
wrapProgram $out/bin/evcxr --prefix PATH : ${stdenv.lib.makeBinPath [ cargo gcc ]}
|
wrapProgram $out/bin/evcxr --prefix PATH : ${stdenv.lib.makeBinPath [ cargo gcc ]}
|
||||||
|
wrapProgram $out/bin/evcxr_jupyter --prefix PATH : ${stdenv.lib.makeBinPath [ cargo gcc ]}
|
||||||
rm $out/bin/testing_runtime
|
rm $out/bin/testing_runtime
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user