nmattia / niv

Easy dependency management for Nix projects
https://github.com/nmattia/niv
MIT License
1.61k stars 79 forks source link

Adding private repo with GITHUB_TOKEN doesn't seem to work #250

Closed mcwitt closed 4 years ago

mcwitt commented 4 years ago

I'm having trouble adding a private GitHub repo. To reproduce:

GITHUB_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx niv add my-private-repo --owner mcwitt --repo private-repo

results in

FATAL: Could not read the output of 'nix-prefetch-url'. This is a bug.
...
stderr:
  error: unable to download 'https://github.com/mcwitt/private-repo/archive/a1aa158e7a56847cce649b4ea9f734bef45561d3.tar.gz': HTTP error 404

I can copy the URL into my browser and download the file without issue; it seems likely that the cause is GITHUB_TOKEN not being sent with the request.

mcwitt commented 4 years ago

Sorry, just realized this is my fault, I had missed the part about setting up the .netrc file.