Closed tfc closed 4 years ago
file://git@github.com:tfc/cmake_cpp_example.git
This is an odd URL, shouldn't this be either file://
or SSH? What happens if you remove the file://
?
I never added the file://
prefix. the sources.json does not contain it.
ok, that's odd. I've had so many segfaults with nixFlakes
that I stopped using it; I suspect it might be a bug there. What happens if you set the url to ssh://git@...
instead?
then it says
$ nix-instantiate
error: --- BadURL ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ nix-instantiate
'ssh://git@github.com:tfc/cmake_cpp_example.git' is not a valid URL
ok, with ssh://
I think you need to replace :
with /
:
[nix-shell:/tmp/tmp.TXuGlnCBbT]$ cat default.nix
builtins.fetchGit { url = "ssh://git@github.com/tfc/cmake_cpp_example"; ref = "refs/heads/master"; }
[nix-shell:/tmp/tmp.TXuGlnCBbT]$ nix-build
# basically ok
not sure why exactly to be perfectly honest, will need to investigate a bit more
hm, can't reproduce:
nix-repl> builtins.fetchGit { ref = "master"; rev = "15e516d23f8b9d213c83e15f5d73fc7dc37ea22a"; url = "ssh://git@github.com:tfc/cmake_cpp_example.git"; }
error: --- BadURL ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ nix
'ssh://git@github.com:tfc/cmake_cpp_example.git' is not a valid URL
nix-repl> builtins.fetchGit { ref = "master"; rev = "15e516d23f8b9d213c83e15f5d73fc7dc37ea22a"; url = "git@github.com:tfc/cmake_cpp_example.git"; }
error: --- BadURL ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ nix
'file://git@github.com:tfc/cmake_cpp_example.git' is not a valid URL
but at this point it's clear that it's rather a bug in nix than in niv.
oh sorry i did not get that you mean to replace the :
after the hostname. doing that, it works.
I'm closing this for now, feel free to reopen if you think niv should do some special handling.
Fixed this by applying this patch:
- "repo": "git@github.com:repo"
+ "repo": "ssh://git@github.com/repo"
Hi there,
not sure if this is:
However, this issue is not about using flakes. I just have flakes activated in my system and with this setting, normal niv projects that use git don't work any longer.
I created a minimal example repo and within that, the following does not work:
The repo: https://github.com/tfc/niv_flakes_git_problem
i just added the one source item with
niv add git ...
.Output with
--show-trace
: