Add template shell.nix for python development

This commit is contained in:
Evie Litherland-Smith 2023-03-31 09:38:04 +01:00
parent 75486b9726
commit 680f60db81

24
templates/python.nix Normal file
View file

@ -0,0 +1,24 @@
{ pkgs ? import <nixpkgs> { } }:
let
python-packages = ps: with ps; [
pip
setuptools
wheel
];
in
with pkgs;
(buildFHSUserEnv {
name = "python";
targetPkgs = pkgs: [ ];
multiPkgs = pkgs: [
zlib zlib-ng
(python39.withPackages python-packages)
];
runScript = ''
bash -c "{
python -m venv .venv
source .venv/bin/activate
}"
'';
}).env