Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
fetch-tangled fetcher.nix
1.8 kB · 85 lines
Nix
at fp
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586# this is really just a fork of fetchFromGitHub, but with a few changes due to# incompatibilities. furthermore, there is no such concept of private in# atproto, so all the private stuff has been removed.
{ lib, fetchFromGitProvider,}:
lib.makeOverridable ( lib.extendMkDerivation { constructDrv = fetchFromGitProvider;
excludeDrvArgNames = [ "domain" "owner"
"useFetchGit" ];
extendDrvArgs = finalAttrs: { domain ? "tangled.org", owner, repo, rev ? null, tag ? null, passthru ? { }, meta ? { }, ... }@args:
let
position = ( if args.meta.description or null != null then builtins.unsafeGetAttrPos "description" args.meta else if tag != null then builtins.unsafeGetAttrPos "tag" args else builtins.unsafeGetAttrPos "rev" args );
baseUrl = "https://${domain}/${owner}/${repo}";
newMeta = meta // { homepage = meta.homepage or baseUrl; } // lib.optionalAttrs (position != null) { # to indicate where derivation originates, similar to make-derivation.nix's mkDerivation position = "${position.file}:${toString position.line}"; };
in
{ providerName = "tangled";
derivationArgs = { inherit domain owner ; };
inherit repo;
gitRepoUrl = baseUrl;
fetchZipArgs = let revWithTag = finalAttrs.rev; in { url = "${baseUrl}/archive/${revWithTag}"; extension = "tar.gz"; };
meta = newMeta; }; })