add support for sourcehut

This commit is contained in:
Alper Çelik 2023-04-26 10:33:29 +03:00
parent 35bb57c0c8
commit bcb80df051
No known key found for this signature in database
GPG key ID: FA90C0AB738AB873

View file

@ -63,6 +63,15 @@ let
); );
shortRev = builtins.substring 0 7 info.rev; shortRev = builtins.substring 0 7 info.rev;
} }
else if info.type == "sourcehut" then
{ inherit (info) rev narHash lastModified;
outPath =
fetchTarball
({ url = "https://${info.host or "git.sr.ht"}/${info.owner}/${info.repo}/archive/${info.rev}.tar.gz"; }
// (if info ? narHash then { sha256 = info.narHash; } else {})
);
shortRev = builtins.substring 0 7 info.rev;
}
else else
# FIXME: add Mercurial, tarball inputs. # FIXME: add Mercurial, tarball inputs.
throw "flake input has unsupported input type '${info.type}'"; throw "flake input has unsupported input type '${info.type}'";