mirror of
https://github.com/edolstra/flake-compat.git
synced 2024-12-15 17:50:56 +00:00
Merge pull request #8 from Ma27/gitlab-fetcher
Add support for flake inputs with `type = "gitlab"`
This commit is contained in:
commit
2f9a141d4b
1 changed files with 6 additions and 1 deletions
|
@ -16,7 +16,7 @@ let
|
|||
fetchTree =
|
||||
info:
|
||||
if info.type == "github" then
|
||||
{ outPath = fetchTarball "https://api.github.com/repos/${info.owner}/${info.repo}/tarball/${info.rev}";
|
||||
{ outPath = fetchTarball "https://api.${info.url or "github.com"}/repos/${info.owner}/${info.repo}/tarball/${info.rev}";
|
||||
rev = info.rev;
|
||||
shortRev = builtins.substring 0 7 info.rev;
|
||||
lastModified = info.lastModified;
|
||||
|
@ -44,6 +44,11 @@ let
|
|||
{ outPath = fetchTarball info.url;
|
||||
narHash = info.narHash;
|
||||
}
|
||||
else if info.type == "gitlab" then
|
||||
{ inherit (info) rev narHash lastModified;
|
||||
outPath = fetchTarball "https://${info.url or "gitlab.com"}/${info.owner}/${info.repo}/-/archive/${info.rev}/${info.repo}-${info.rev}.tar.gz";
|
||||
shortRev = builtins.substring 0 7 info.rev;
|
||||
}
|
||||
else
|
||||
# FIXME: add Mercurial, tarball inputs.
|
||||
throw "flake input has unsupported input type '${info.type}'";
|
||||
|
|
Loading…
Reference in a new issue