Update nix python shell templates
This commit is contained in:
parent
b22cf00056
commit
f7f909d615
31
templates
31
templates
|
@ -167,26 +167,33 @@ nix-mode
|
||||||
"platforms = platforms."
|
"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> "}"
|
(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 "<nixpkgs>") " {};" n
|
(pythonshell "let" n
|
||||||
> "mkShellNoCC {" n
|
> "pkgs = import " (p "<nixpkgs>") " {};" n
|
||||||
|
> "in pkgs.mkShellNoCC {" n
|
||||||
> "packages = [" n
|
> "packages = [" n
|
||||||
> "(" (p "python3") ".withPackages" n
|
> "(pkgs." (p "python3") ".withPackages" n
|
||||||
> "(ps: with ps; ["(p "python-lsp-server isort mypy") "]))" n
|
> "(ps: with ps; ["(p "mypy") "]))" n
|
||||||
> q n
|
> q n
|
||||||
> "];" n
|
> "];" n
|
||||||
> "}")
|
> "}")
|
||||||
(poetryshell "# See https://github.com/nix-community/poetry2nix/blob/master/docs/edgecases.md#cases" n
|
(poetryshell "# See https://github.com/nix-community/poetry2nix/blob/master/docs/edgecases.md#cases" n
|
||||||
"# for edgecases like setuptools not found" n
|
"# for edgecases like setuptools not found" n
|
||||||
"with import " (p "<nixpkgs>") " {};" n
|
"let" n
|
||||||
"with (builtins.getFlake \"github:nix-community/poetry2nix\").lib.mkPoetry2Nix {inherit pkgs;};" n
|
> "pkgs = import " (p "<nixpkgs>") " {};" n
|
||||||
> "(mkPoetryEnv rec {" n
|
> "poetry2nix = (builtins.getFlake \"github:nix-community/poetry2nix\").lib.mkPoetry2Nix {inherit pkgs;};" n
|
||||||
> "projectDir = ./.;" n
|
> "env = with poetry2nix; let " n
|
||||||
|
> "projectDir = " (p "./.") ";" n
|
||||||
|
> "in (mkPoetryEnv rec {" n
|
||||||
|
> "inherit projectDir;" n
|
||||||
|
> "python = " (p "pkgs.python3") ";" n
|
||||||
> "preferWheels = true;" n
|
> "preferWheels = true;" n
|
||||||
> "extras = [\"*\"];" n
|
> "extras = [\"*\"];" n
|
||||||
> "editablePackageSources = {" (p "package") "=projectDir;};" n
|
> "editablePackageSources = {" (p "package") "=projectDir;};" n
|
||||||
> "extraPackages = ps: with ps; [" (p "python-lsp-server isort mypy") " " q "];" n
|
> "});" n
|
||||||
> "})" n
|
"in" n
|
||||||
> ".env")
|
> "pkgs.mkShellNoCC {" n
|
||||||
|
> "packages = [pkgs.poetry env " q "];" n
|
||||||
|
> "}")
|
||||||
(poetryoverride "overrides = defaultPoetryOverrides.extend" n
|
(poetryoverride "overrides = defaultPoetryOverrides.extend" n
|
||||||
> "(self: super: {" n
|
> "(self: super: {" n
|
||||||
> (s package) " =" n
|
> (s package) " =" n
|
||||||
|
@ -194,7 +201,7 @@ nix-mode
|
||||||
> "(old: {" n
|
> "(old: {" n
|
||||||
> "buildInputs = (old.buildInputs or []) ++ [super." (p "setuptools" ) "];" n
|
> "buildInputs = (old.buildInputs or []) ++ [super." (p "setuptools" ) "];" n
|
||||||
> "});" n
|
> "});" n
|
||||||
> "});")
|
> "});" q)
|
||||||
|
|
||||||
python-base-mode
|
python-base-mode
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue