Open Silver-Golden opened 11 months ago
For me on Nix 2.18, using the attribute set representation, as described in https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake#flake-references works properly.
ie.
inputs.example = {
type = "gitlab";
owner = "group%2Fsubgroup";
repo = "repo";
};
I can confirm this issue. A gitlab repo that is a subgroup two levels deep doesn't get parsed properly:
Gitlab project: https://gitlab.com/freepascal.org/lazarus/lazarus
inputs = {
...
lazarusSrc = {
url ="gitlab:freepascal.org%2Flazarus%2flazarus";
flake = false;
};
};
error while fetching the input 'gitlab:freepascal.org/lazarus/lazarus' error: unable to download 'https://gitlab.com/api/v4/projects/freepascal.org%2Flazarus/repository/commits?ref_name=lazarus': HTTP error 404 response body: {"message":"404 Project Not Found"}
The correct API link should use something like this: https://gitlab.com/api/v4/projects/freepascal.org%2Flazarus%2Flazarus/repository/commits
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
Describe the bug
The recent change in #6614 broke flake url's for gitlab.
The cause of this is that the gitlab libfetcher uses the github logic of
owner/project/branch
Steps To Reproduce (from https://github.com/NixOS/nix/pull/8773#issuecomment-1753901794)
This worked fine on 2.13.2 at least, not sure what was last version it worked on.
If I change the last slash in it to
%2F
result is the sameand for funsies use all
/
, still same errorExpected behavior
There is no error in downloading and using gitlab flakes.
nix-env --version
outputnix-env (Nix) 2.18.1
Additional context
I am working on teh patch for split out the url parsing logic from teh github version.
Priorities
Add :+1: to issues you find important.