Open talbergs opened 1 year ago
Here's a much more idiomatic expression:
{ pkgs ? import <nixpkgs> {}
, poetry2nix ? pkgs.poetry2nix
, fetchFromGitHub ? pkgs.fetchFromGitHub
}:
poetry2nix.mkPoetryApplication {
projectDir = fetchFromGitHub {
owner = "NayamAmarshe";
repo = "please";
rev = "0.3.1";
hash = "sha256-sQErUOGx+PXX6laqiRsJ5z3HEeEbWhlXkTIjipz1NcU=";
};
postPatch = "rm -r dist";
}
Note, however, that this uses IFD as stated (IFD isn't allowed in nixpkgs, among other issues). To avoid that, you'd need to keep a copy of the poetry.lock
and pyproject.toml
with the nix code and set
pyproject = ./pyproject.toml;
poetrylock = ./poetry.lock;
However if this lived in this repo, for example in contrib
, then you could instead just set projectDir = ../.;
instead of any of that.
For a "contrib" folder here, using poetry2nix
is probably fine, though for any packaging attempt in nixpkgs
I'd recommend the usage of buildPythonModule
+ format = "pyproject"
and toPythonApplication
at the top-level to increase sharability within the closure.
There usually is a
./contrib
folder that contains some integration-like files.Some nix expert may come along and help in with the idiomic way. But there is what worked for my flake.nix
I hope for someone to publish a correct package not only to AUR but also to
nixpkgs