Poetry2nix turns Poetry projects into Nix derivations without the need to actually write Nix expressions.
It does so by parsing pyproject.toml and poetry.lock and converting them to Nix derivations on the fly.
The easiest way to import poetry2nix is as an overlay.
let
pkgs = import <nixpkgs> {
overlays = [
(import ((builtins.fetchTarball { url = https://github.com/adisbladis/poetry2nix/archive/master.tar.gz; }) + "/overlay.nix"))
];
};
in pkgs.poetry2nix.mkPoetryPackage {
python = python3;
pyproject = ./pyproject.toml;
poetryLock = ./poetry.lock;
src = lib.cleanSource ./.;
}Poetry2nix is also available as a Nix flake.
poetry2nix is released under the terms of the MIT license.