1# Options that can be used for creating a jupyter kernel.
2{ lib, pkgs }:
3
4with lib;
5
6{
7 freeformType = (pkgs.formats.json { }).type;
8
9 options = {
10
11 displayName = mkOption {
12 type = types.str;
13 default = "";
14 example = literalExpression ''
15 "Python 3"
16 "Python 3 for Data Science"
17 '';
18 description = lib.mdDoc ''
19 Name that will be shown to the user.
20 '';
21 };
22
23 argv = mkOption {
24 type = types.listOf types.str;
25 example = [
26 "{customEnv.interpreter}"
27 "-m"
28 "ipykernel_launcher"
29 "-f"
30 "{connection_file}"
31 ];
32 description = lib.mdDoc ''
33 Command and arguments to start the kernel.
34 '';
35 };
36
37 language = mkOption {
38 type = types.str;
39 example = "python";
40 description = lib.mdDoc ''
41 Language of the environment. Typically the name of the binary.
42 '';
43 };
44
45 env = mkOption {
46 type = types.attrsOf types.str;
47 default = { };
48 example = { OMP_NUM_THREADS = "1"; };
49 description = lib.mdDoc ''
50 Environment variables to set for the kernel.
51 '';
52 };
53
54 logo32 = mkOption {
55 type = types.nullOr types.path;
56 default = null;
57 example = literalExpression ''"''${env.sitePackages}/ipykernel/resources/logo-32x32.png"'';
58 description = lib.mdDoc ''
59 Path to 32x32 logo png.
60 '';
61 };
62 logo64 = mkOption {
63 type = types.nullOr types.path;
64 default = null;
65 example = literalExpression ''"''${env.sitePackages}/ipykernel/resources/logo-64x64.png"'';
66 description = lib.mdDoc ''
67 Path to 64x64 logo png.
68 '';
69 };
70
71 extraPaths = mkOption {
72 type = types.attrsOf types.path;
73 default = { };
74 example = literalExpression ''"{ examples = ''${env.sitePack}/IRkernel/kernelspec/kernel.js"; }'';
75 description = lib.mdDoc ''
76 Extra paths to link in kernel directory
77 '';
78 };
79 };
80}