diff --git a/templates b/templates index 34ed316..0699cc5 100644 --- a/templates +++ b/templates @@ -167,26 +167,33 @@ nix-mode "platforms = platforms." (p (completing-read "Platform: " '("all" "allBut" "arm" "cygwin" "darwin" "freebsd" "gnu" "i686" "illumos" "linux" "mesaPlatforms" "mips" "netbsd" "none" "openbsd" "unix" "x86"))) ";" n> q "};" n> "}" ) -(pythonshell "with import " (p "") " {};" n - > "mkShellNoCC {" n +(pythonshell "let" n + > "pkgs = import " (p "") " {};" n + > "in pkgs.mkShellNoCC {" n > "packages = [" n - > "(" (p "python3") ".withPackages" n - > "(ps: with ps; ["(p "python-lsp-server isort mypy") "]))" n + > "(pkgs." (p "python3") ".withPackages" n + > "(ps: with ps; ["(p "mypy") "]))" n > q n > "];" n > "}") (poetryshell "# See https://github.com/nix-community/poetry2nix/blob/master/docs/edgecases.md#cases" n "# for edgecases like setuptools not found" n - "with import " (p "") " {};" n - "with (builtins.getFlake \"github:nix-community/poetry2nix\").lib.mkPoetry2Nix {inherit pkgs;};" n - > "(mkPoetryEnv rec {" n - > "projectDir = ./.;" n + "let" n + > "pkgs = import " (p "") " {};" n + > "poetry2nix = (builtins.getFlake \"github:nix-community/poetry2nix\").lib.mkPoetry2Nix {inherit pkgs;};" n + > "env = with poetry2nix; let " n + > "projectDir = " (p "./.") ";" n + > "in (mkPoetryEnv rec {" n + > "inherit projectDir;" n + > "python = " (p "pkgs.python3") ";" n > "preferWheels = true;" n > "extras = [\"*\"];" n > "editablePackageSources = {" (p "package") "=projectDir;};" n - > "extraPackages = ps: with ps; [" (p "python-lsp-server isort mypy") " " q "];" n - > "})" n - > ".env") + > "});" n + "in" n + > "pkgs.mkShellNoCC {" n + > "packages = [pkgs.poetry env " q "];" n + > "}") (poetryoverride "overrides = defaultPoetryOverrides.extend" n > "(self: super: {" n > (s package) " =" n @@ -194,7 +201,7 @@ nix-mode > "(old: {" n > "buildInputs = (old.buildInputs or []) ++ [super." (p "setuptools" ) "];" n > "});" n - > "});") + > "});" q) python-base-mode