Url format for flake over git + ssh

I can’t figure out what the correct url format is for the “git” type in the flake registry. All examples I find are using github (including the RFC which leaves the attributes unspecified for each type except github).
The following gives “Invalid URL error” using nix-2.4pre20200521_00b562c:

  • ssh+git://git@myhost:/repo.git
  • git@myhost:repo.git
  • ssh+git://myhost:repo.git

These give Name or service not known:

  • git+ssh:git@myhost:repo.git
  • git+ssh:myhost:repo.git

There are no tests (https://github.com/NixOS/nix/blob/9ef6048d784a298f384affdec941b5b38c61346c/src/libutil/tests/url.cc) that would help me figure it out either.

Anyone got this working?
Thanks in advance.


For reference this is the relevant part of my registry.json (using different urls as described above):

    {
      "from": {
        "id": "test",
        "type": "indirect"
      },
      "to": {
        "ref": "flakes",
        "type": "git",
        "url": "{url}"
      }
2 Likes

The correct syntax would be: git+ssh://git@host/repo

7 Likes

How would you specifiy a specific commit?

git+ssh://git@host/repo?rev=82392...2910
3 Likes