mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-05 09:11:39 -05:00
29 lines
1,010 B
Org Mode
29 lines
1,010 B
Org Mode
[[https://gitlab.com/nix-community/poetry2nix/-/jobs][https://gitlab.com/nix-community/poetry2nix/badges/master/pipeline.svg]]
|
|
|
|
* poetry2nix
|
|
Poetry2nix turns [[https://poetry.eustace.io/][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.
|
|
|
|
** Usage
|
|
|
|
*** Example =default.nix=
|
|
The easiest way to import poetry2nix is as an overlay.
|
|
#+begin_src nix
|
|
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 ./.;
|
|
}
|
|
#+END_SRC
|
|
Poetry2nix is also available as a [[https://github.com/NixOS/rfcs/pull/49][Nix flake]].
|
|
|
|
** License
|
|
=poetry2nix= is released under the terms of the MIT license.
|