nixos/templates/poetry.nix

21 lines
497 B
Nix
Raw Normal View History

{ pkgs ? import <nixpkgs> {}, ... }:
pkgs.mkShell {
packages = with pkgs; [
python39
(poetry.override { python3 = python39; })
git
zlib
libgccjit
2023-04-04 17:37:38 +01:00
glibc
glibc_multi
];
shellHook = ''
2023-04-04 17:37:38 +01:00
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)"
2023-04-04 17:37:38 +01:00
[ -d "./.venv" ] && source .venv/bin/activate
'';
}