nixos/templates/poetry.nix

21 lines
497 B
Nix

{ pkgs ? import <nixpkgs> {}, ... }:
pkgs.mkShell {
packages = with pkgs; [
python39
(poetry.override { python3 = python39; })
git
zlib
libgccjit
glibc
glibc_multi
];
shellHook = ''
export LD_LIBRARY_PATH="${pkgs.glibc}/lib:${pkgs.glibc_multi}/lib:${pkgs.zlib}/lib:${pkgs.libgccjit}/lib"
[ ! -f "pyproject.toml" ] && poetry init -n
poetry env use "$(command -v ${pkgs.python39}/bin/python)"
[ -d "./.venv" ] && source .venv/bin/activate
'';
}