dream2nix/lib/internal/fetchers/gitlab/default.nix
2023-07-19 15:53:03 +02:00

33 lines
463 B
Nix

{
pkgs,
utils,
...
}: {
inputs = [
"owner"
"repo"
"rev"
];
versionField = "rev";
outputs = {
owner,
repo,
rev,
...
}: let
b = builtins;
in {
calcHash = algo:
utils.hashPath algo (b.fetchTarball {
url = "https://gitlab.com/${owner}/${repo}/-/archive/${rev}/${repo}-${rev}.tar.gz";
});
fetched = hash:
pkgs.fetchFromGitLab {
inherit owner repo rev hash;
};
};
}