Skip to content

Commit

Permalink
Fix .netrc path (#20)
Browse files Browse the repository at this point in the history
Many builtin fetchers are hard coded to always refer to `$HOME/.netrc`.
The file `$HOME/.config/nix/netrc` is only referenced by
`nixpkgs#fetch*` routines ( I know this sounds like non-sense, but have
faith - it took me ages to debug this last year ).
  • Loading branch information
aakropotkin authored Jul 24, 2023
1 parent c529eea commit 473921f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fix-nix-credentials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ git config --global user.name || git config --global user.name "flox User"

# Allows `builtins.fetch{url,Tarball}' and related to work:
mkdir -p "$HOME/.config/nix";
echo "machine api.github.com password $INPUTS_GITHUB_ACCESS_TOKEN" > "$HOME/.config/nix/netrc"
echo "machine pkgs.github.com password $INPUTS_GITHUB_ACCESS_TOKEN" >> "$HOME/.config/nix/netrc"
echo "machine github.com password $INPUTS_GITHUB_ACCESS_TOKEN" >> "$HOME/.config/nix/netrc"
echo "machine api.github.com password $INPUTS_GITHUB_ACCESS_TOKEN" >> "$HOME/.netrc";
echo "machine pkgs.github.com password $INPUTS_GITHUB_ACCESS_TOKEN" >> "$HOME/.netrc";
echo "machine github.com password $INPUTS_GITHUB_ACCESS_TOKEN" >> "$HOME/.netrc";
ln -sr "$HOME/.netrc" "$HOME/.config/nix/netrc";

# Close the log message group which was opened above
echo "::endgroup::"

0 comments on commit 473921f

Please sign in to comment.