I have a custom package defined in my nixOS config. I can’t get builtins.fetchGit to access a private GitHub repo running nixOS 23.05. This previously worked with nixOS 22.11.
src = builtins.fetchGit {
url = "ssh://git@github.com/privateorg/privaterepo.git";
ref = "main";
rev = "commithash";
allRefs = true;
};
nixos-rebuild fails with this message:
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
ssh -T git@github.com
works…
so does git clone ssh://git@github.com/privateorg/privaterepo.git
I can also run nix profile install .#mypackage
and it works.
So why can’t I install/build via nixos-rebuild
?
Running nixOS 23.05, and my SSH config ~/.ssh is proper, and I’m also using an SSH_AUTH_SOCK that has SSH access to GitHub.