Nix flake private repos

I’m trying to use a private repo, let’s say, as an input to a Nix flake.

Setting a github access token in .config/nix/nix.conf:

access-tokens =

Works as normal with github:foo/bar as a flake input.

But I’d rather rely on my existing ssh authentication rather than having to create and maintain access tokens.

git+ssh://, as suggested in:

Doesn’t work:

$ nix build
fetching Git repository 'ssh://'fatal: couldn't find remote ref refs/heads/master
error: program 'git' failed with exit code 128

Any suggestions?

Well, I solved that rather quickly, the branch is main not master

1 Like
Hosted by Flying Circus.