From ea7ebb0afb94e5111081c3cef5d5e9d904a83130 Mon Sep 17 00:00:00 2001 From: thomasjm Date: Wed, 2 Oct 2024 04:30:09 -0700 Subject: [PATCH] Add pypy3 sample environment --- modules/kernels/python/default.nix | 4 +++- modules/kernels/python/module.nix | 4 ++++ sample_environments.nix | 1 + sample_environments/pypy3.nix | 13 +++++++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 sample_environments/pypy3.nix diff --git a/modules/kernels/python/default.nix b/modules/kernels/python/default.nix index 3e16e88..be1848d 100644 --- a/modules/kernels/python/default.nix +++ b/modules/kernels/python/default.nix @@ -9,6 +9,8 @@ , python3 +, name + , settings , settingsSchema }: @@ -22,7 +24,7 @@ let hasPythonLspServer = python: (lib.hasAttr "python-lsp-server" python.pkgs) && (lib.versionAtLeast python.pythonVersion "3.7"); hasPythonLanguageServer = python: lib.hasAttr "python-language-server" python.pkgs; - displayName = "Python " + python3.version; + displayName = name + " " + python3.version; kernelName = "python3"; packageOptions = python3.pkgs; diff --git a/modules/kernels/python/module.nix b/modules/kernels/python/module.nix index 80a1f80..3173cf7 100644 --- a/modules/kernels/python/module.nix +++ b/modules/kernels/python/module.nix @@ -132,6 +132,8 @@ in else lib.getAttr x config.pkgs; in config.pkgs.callPackage ./. { + name = "Python"; + python3 = basePython; settings = config.kernels.python3; @@ -142,6 +144,8 @@ in (mkIf config.kernels.pypy3.enable { builtKernels.pypy3 = config.pkgs.callPackage ./. { + name = "PyPy"; + python3 = lib.getAttr config.kernels.pypy3.python3Package config.pkgs; settings = config.kernels.pypy3; diff --git a/sample_environments.nix b/sample_environments.nix index 26f177c..8431547 100644 --- a/sample_environments.nix +++ b/sample_environments.nix @@ -19,6 +19,7 @@ args: { mega = import ./sample_environments/mega.nix args; octave = import ./sample_environments/octave.nix args; postgres = import ./sample_environments/postgres.nix args; + pypy3 = import ./sample_environments/pypy3.nix args; python3 = import ./sample_environments/python3.nix args; r = import ./sample_environments/r.nix args; ruby = import ./sample_environments/ruby.nix args; diff --git a/sample_environments/pypy3.nix b/sample_environments/pypy3.nix new file mode 100644 index 0000000..8091b2a --- /dev/null +++ b/sample_environments/pypy3.nix @@ -0,0 +1,13 @@ +{ codedown +, channels ? {} +, ... +}: + +codedown.makeEnvironment { + kernels.pypy3.enable = true; + kernels.pypy3.packages = [ + "matplotlib" + "scipy" + "rope" + ]; +}