From f84d21d67e7e78f1caac5d78b8aeb94594e75cd3 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Sun, 24 Mar 2024 12:03:04 +0000 Subject: [PATCH] Update poetryshell template, add (initial) pythonshell template --- templates | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/templates b/templates index 84db4c7..e25b963 100644 --- a/templates +++ b/templates @@ -176,15 +176,21 @@ 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 "") ; TODO -(poetryshell "let" - n> "pkgs = import (builtins.getFlake \"github:nixos/nixpkgs" (p "/23.11")"\") {};" - n> "poetry2nix = (builtins.getFlake \"github:nix-community/poetry2nix\").lib.mkPoetry2Nix {inherit pkgs;};" - n> "in" - n> "pkgs.mkShellNoCC {" - n> "packages = [" (p "pkgs.poetry poetry2nix.mkPoetryEnv {projectDir = ./.; preferWheels = true;}") "];" - n> "}") -(poetrypackage "") ; TODO +(pythonshell "with import (builtins.getFlake \"github:nixos/nixpkgs" (p "/23.11")"\") {};" + n> "with python3Packages;" + n> "mkShellNoCC {" + n> "packages = [" (p) "];" + n> "};") +(poetryshell "with import (builtins.getFlake \"github:nixos/nixpkgs" (p "/23.11")"\") {};" + n "with (builtins.getFlake \"github:nix-community/poetry2nix\").lib.mkPoetry2Nix {inherit pkgs;};" + n> "(mkPoetryEnv rec {" + n> "projectDir = ./.;" + n> "preferWheels = true;" + n> "extras = [\"*\"];" + n> "editablePackageSources = {" (p "package") "=projectDir;};" + n> "extraPackages = ps: with ps; [" (p "isort mypy")"];" + n> "})" + n> ".env") python-base-mode