Same kind of error with nix flake check for example.
In fact, any of the non root nix command will be blocked by api.github.com with 404 even though the token is valid to fetch private repo.
I suspect this has to do with the permission of running nix as non root.
For example, if I put access-tokens = github.com=xxx into that file and make sure my user can access /my/github/access_token_file
nix flake metadata github:xxx/xxx or any of the other nix flake command can go through with the token successfully. Otherwise only the sudo nix command can access github private repo.
My observation is tested on my local nixos box, but it's probably the same cause for the CI failure.
steps to reproduce:
error: unable to download 'https://api.github.com/repos/myuser/myprivaterepo/commits/HEAD': HTTP error 404
Same kind of error with
nix flake check
for example. In fact, any of the non root nix command will be blocked by api.github.com with 404 even though the token is valid to fetch private repo.I suspect this has to do with the permission of running nix as non root. For example, if I put
access-tokens = github.com=xxx
into that file and make sure my user can access /my/github/access_token_filethen
nix flake metadata github:xxx/xxx
or any of the other nix flake command can go through with the token successfully. Otherwise only the sudo nix command can access github private repo.My observation is tested on my local nixos box, but it's probably the same cause for the CI failure.