Add optional Jupyter kernelspec options from the spec (#55989)
This commit is contained in:
parent
0426ae63f8
commit
f72d7c49d5
@ -37,15 +37,15 @@ in
|
||||
installPhase = ''
|
||||
mkdir kernels
|
||||
|
||||
${concatStringsSep "\n" (mapAttrsToList (kernelName: kernel:
|
||||
${concatStringsSep "\n" (mapAttrsToList (kernelName: unfilteredKernel:
|
||||
let
|
||||
config = builtins.toJSON {
|
||||
display_name = if (kernel.displayName != "")
|
||||
then kernel.displayName
|
||||
else kernelName;
|
||||
argv = kernel.argv;
|
||||
language = kernel.language;
|
||||
};
|
||||
allowedKernelKeys = ["argv" "displayName" "language" "interruptMode" "env" "metadata" "logo32" "logo64"];
|
||||
kernel = traceVal (filterAttrs (n: v: (any (x: x == n) allowedKernelKeys)) unfilteredKernel);
|
||||
config = builtins.toJSON (
|
||||
kernel
|
||||
// {display_name = if (kernel.displayName != "") then kernel.displayName else kernelName;}
|
||||
// (optionalAttrs (kernel ? interruptMode) { interrupt_mode = kernel.interruptMode; })
|
||||
);
|
||||
logo32 =
|
||||
if (kernel.logo32 != null)
|
||||
then "ln -s ${kernel.logo32} 'kernels/${kernelName}/logo-32x32.png';"
|
||||
|
Loading…
Reference in New Issue
Block a user