nixos/templates/python.nix

25 lines
388 B
Nix
Raw Normal View History

{ 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