nixos/templates/python.nix

25 lines
388 B
Nix

{ 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