chore(lib): add fetchNixletFromGitlab function

This commit is contained in:
technofab 2024-05-08 21:31:34 +02:00
parent ef74421f26
commit eb1fd4cdd2
2 changed files with 10 additions and 1 deletions

View file

@ -91,6 +91,15 @@ with lib; rec {
};
fetchNixlet = url: sha256: mkNixlet (builtins.fetchTarball {inherit url sha256;});
fetchNixletFromGitlab = {
project,
name,
version,
sha256,
}: let
projectEscaped = builtins.replaceStrings ["/"] ["%2F"] project;
in
fetchNixlet "https://gitlab.com/api/v4/projects/${projectEscaped}/packages/generic/${name}/${version}/${name}.tar.gz" sha256;
uploadNixletsToGitlab = {
pkgs,