nix-community/poetry2nix

Private Python package documentation is wrong

oni303 opened this issue · 1 comments

Describe the issue

The documentation regarding "Using private Python package repositories with authentication" has some mistakes and does not lead to a working setup after fixing the obvious one.

Additional context

I am trying to build a flake from a poetry package that needs a few private packages which are hosted on a gitlab server that requires authentication. After following the steps in the documentation, gitlab still returns error 401 Unauthorized.
The netrc file is extra-sandbox-paths is used by nix, as I get a "file not found" if I miss-spell it.
I noticed, that the env-vars file in my sandbox states declare -x NETRC="".
Does anyone have an idea how to use poetry2nix with private repositories?

my changes

nix.conf

extra-sandbox-paths /etc/nix/netrc
trusted-users <username>

should be

extra-sandbox-paths = /etc/nix/netrc
trusted-users = <username>

otherwise nix daemon crashes with a "illegal configuration line" error

netrc

on this one I am less certain but I think:

machine https://example.org

should be

machine example.org

Could you create a first PR on the documentation fixes. Both your points are valid.

If you haven't done so, you still have to pass in the path to the netrc file via the nix-build command and you could try passing the extra-sandbox-path again explictly:

nix-build -I NETRC=/etc/nix/netrc --option extra-sandbox-paths /etc/nix/netrc ...