nixpkgs/nixos/modules/services/development/jupyter/kernel-options.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

80 lines
2 KiB
Nix
Raw Normal View History

2018-01-12 00:13:55 +01:00
# Options that can be used for creating a jupyter kernel.
{ lib, pkgs }:
2018-01-12 00:13:55 +01:00
{
freeformType = (pkgs.formats.json { }).type;
2018-01-12 00:13:55 +01:00
options = {
displayName = lib.mkOption {
type = lib.types.str;
2018-01-12 00:13:55 +01:00
default = "";
example = lib.literalExpression ''
2018-01-12 00:13:55 +01:00
"Python 3"
"Python 3 for Data Science"
'';
2018-01-12 00:13:55 +01:00
description = ''
Name that will be shown to the user.
'';
};
argv = lib.mkOption {
type = lib.types.listOf lib.types.str;
2018-01-12 00:13:55 +01:00
example = [
"{customEnv.interpreter}"
"-m"
"ipykernel_launcher"
"-f"
"{connection_file}"
];
description = ''
Command and arguments to start the kernel.
'';
};
language = lib.mkOption {
type = lib.types.str;
2018-01-12 00:13:55 +01:00
example = "python";
description = ''
Language of the environment. Typically the name of the binary.
'';
};
env = lib.mkOption {
type = lib.types.attrsOf lib.types.str;
2021-03-30 12:31:59 +03:00
default = { };
example = {
OMP_NUM_THREADS = "1";
};
description = ''
Environment variables to set for the kernel.
'';
};
logo32 = lib.mkOption {
type = lib.types.nullOr lib.types.path;
2018-01-12 00:13:55 +01:00
default = null;
example = lib.literalExpression ''"''${env.sitePackages}/ipykernel/resources/logo-32x32.png"'';
2018-01-12 00:13:55 +01:00
description = ''
Path to 32x32 logo png.
'';
};
logo64 = lib.mkOption {
type = lib.types.nullOr lib.types.path;
2018-01-12 00:13:55 +01:00
default = null;
example = lib.literalExpression ''"''${env.sitePackages}/ipykernel/resources/logo-64x64.png"'';
2018-01-12 00:13:55 +01:00
description = ''
Path to 64x64 logo png.
'';
};
extraPaths = lib.mkOption {
type = lib.types.attrsOf lib.types.path;
default = { };
example = lib.literalExpression ''"{ examples = ''${env.sitePack}/IRkernel/kernelspec/kernel.js"; }'';
description = ''
Extra paths to link in kernel directory
'';
};
2018-01-12 00:13:55 +01:00
};
}