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