use builtin fetchers to prevent importing from derivation

This commit is contained in:
ccicnce113424 2025-06-10 23:58:10 +08:00 committed by Gavin John
parent 8526cad551
commit f71b30bf0e
2 changed files with 28 additions and 4 deletions

View file

@ -47,6 +47,14 @@ else if (lib.hasPrefix "https://gitlab.com" attr.url || type == "gitlab") && !su
else
fetchgit {
inherit (attr) url;
inherit (revision) rev sha256;
fetchSubmodules = submodules;
inherit (revision) rev;
}
// (
if fetchgit == builtins.fetchGit or null then
{ inherit submodules; }
else
{
inherit (revision) sha256;
fetchSubmodules = submodules;
}
)