From f32764b652eec98c7055a127621c360d1afb2b1c Mon Sep 17 00:00:00 2001 From: Jan-Bulthuis Date: Sun, 9 Feb 2025 23:45:15 +0100 Subject: [PATCH] Updated python --- shell-modules/languages/python.nix | 18 +++++++++--------- shell-modules/utilities/cuda.nix | 1 - shell-modules/utilities/jupyter.nix | 2 +- user-modules/development/language/python.nix | 1 + 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/shell-modules/languages/python.nix b/shell-modules/languages/python.nix index 0d209cc..e312b1c 100644 --- a/shell-modules/languages/python.nix +++ b/shell-modules/languages/python.nix @@ -6,6 +6,10 @@ }: with lib; +let + packages = config.python.packages; + pythonPackage = pkgs.python3.withPackages packages; +in { options.python = { enable = mkEnableOption "Python"; @@ -22,14 +26,10 @@ with lib; }; config = mkIf config.python.enable { - packages = - with pkgs; - let - packages = config.python.packages; - pythonPackage = python3.withPackages packages; - in - [ - pythonPackage - ]; + packages = [ + pythonPackage + ]; + + env.PYTHONINTERPRETER = "${pythonPackage}/bin/python"; }; } diff --git a/shell-modules/utilities/cuda.nix b/shell-modules/utilities/cuda.nix index 024a36b..91748d8 100644 --- a/shell-modules/utilities/cuda.nix +++ b/shell-modules/utilities/cuda.nix @@ -11,6 +11,5 @@ with lib; }; config = mkIf config.cuda.enable { - }; } diff --git a/shell-modules/utilities/jupyter.nix b/shell-modules/utilities/jupyter.nix index a4c0a06..3c9589d 100644 --- a/shell-modules/utilities/jupyter.nix +++ b/shell-modules/utilities/jupyter.nix @@ -12,11 +12,11 @@ with lib; config = mkIf config.jupyter.enable { python.enable = mkDefault true; - python.packages = p: with p; [ jupyter notebook + ipykernel ]; }; } diff --git a/user-modules/development/language/python.nix b/user-modules/development/language/python.nix index 2680023..46a8fca 100644 --- a/user-modules/development/language/python.nix +++ b/user-modules/development/language/python.nix @@ -42,6 +42,7 @@ in ]; userSettings = { + "python.defaultInterpreterPath" = "\${env:PYTHONINTERPRETER}"; "[python]" = { "editor.defaultFormatter" = "ms-python.black-formatter"; };