Skip to content

Commit c369e62

Browse files
doc: how to use a Github token to work around rate limits
1 parent eb8af30 commit c369e62

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,37 @@ pkg list
9393
pkg search helix
9494
```
9595

96+
## Troubleshooting
97+
98+
**Github rate limits**
99+
100+
In case you hit Github's rate limit when installing a package:
101+
```
102+
* snmpd does not exist. Install net-snmp package? [y/N]
103+
error:
104+
… while updating the lock file of flake 'path:/nix/.cache/env-flake?lastModified=1765815061&narHash=sha256-gUo0/L8xm6/4Ky19XkxEmU3fQ0jfQbwJDI%2BI9cRfeCQ%3D'
105+
… while updating the flake input 'flake-utils'
106+
… while fetching the input 'github:numtide/flake-utils'
107+
error: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/HEAD': HTTP error 403
108+
response body:
109+
{"message":"API rate limit exceeded for x.x.x.x. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}
110+
```
111+
112+
You should add your Github token (any read-only token will work) to the Nix configuration:
113+
```
114+
GITHUB_TOKEN="****your token****"
115+
echo "access-tokens = github.com=${GITHUB_TOKEN}" >> ~/.local/state/dive/base-img/etc/nix.conf
116+
```
117+
118+
The file will then look like this:
119+
```
120+
experimental-features = nix-command flakes
121+
extra-nix-path = nixpkgs=github:nixos/nixpkgs/nixos-25.05
122+
build-users-group =
123+
sandbox = false
124+
access-tokens = github.com=...
125+
```
126+
96127
## Contributing
97128

98129
Contributions are welcome! Feel free to open issues and pull requests.

0 commit comments

Comments
 (0)