lol

fetchRadiclePatch: init

Defelo c2ec9234 8bb4e100

+62
+15
doc/build-helpers/fetchers.chapter.md
··· 914 914 } 915 915 ``` 916 916 917 + ## `fetchRadiclePatch` {#fetchradiclepatch} 918 + 919 + `fetchRadiclePatch` works very similarly to `fetchFromRadicle` with almost the same arguments 920 + expected. However, instead of a `rev` or `tag` argument, a `revision` argument is expected, which 921 + contains the full revision id of the Radicle patch to fetch. 922 + 923 + ```nix 924 + fetchRadiclePatch { 925 + seed = "rosa.radicle.xyz"; 926 + repo = "z4V1sjrXqjvFdnCUbxPFqd5p4DtH5"; # radicle-explorer 927 + revision = "d97d872386c70607beda2fb3fc2e60449e0f4ce4"; # patch: d77e064 928 + hash = "sha256-ttnNqj0lhlSP6BGzEhhUOejKkkPruM9yMwA5p9Di4bk="; 929 + } 930 + ``` 931 + 917 932 ## `requireFile` {#requirefile} 918 933 919 934 `requireFile` allows requesting files that cannot be fetched automatically, but whose content is known.
+3
doc/redirects.json
··· 1669 1669 "fetchfromradicle": [ 1670 1670 "index.html#fetchfromradicle" 1671 1671 ], 1672 + "fetchradiclepatch": [ 1673 + "index.html#fetchradiclepatch" 1674 + ], 1672 1675 "requirefile": [ 1673 1676 "index.html#requirefile" 1674 1677 ],
+43
pkgs/build-support/fetchradiclepatch/default.nix
··· 1 + { 2 + fetchFromRadicle, 3 + jq, 4 + lib, 5 + }: 6 + 7 + lib.makeOverridable ( 8 + { 9 + revision, 10 + postFetch ? "", 11 + nativeBuildInputs ? [ ], 12 + ... 13 + }@args: 14 + 15 + assert lib.assertMsg ( 16 + !args ? rev && !args ? tag 17 + ) "fetchRadiclePatch does not accept `rev` or `tag` arguments."; 18 + 19 + fetchFromRadicle ( 20 + { 21 + nativeBuildInputs = [ jq ] ++ nativeBuildInputs; 22 + rev = revision; 23 + leaveDotGit = true; 24 + postFetch = '' 25 + { read -r head; read -r base; } < <(jq -r '.oid, .base' $out/0) 26 + git -C $out fetch --depth=1 "$url" "$base" "$head" 27 + git -C $out diff "$base" "$head" > patch 28 + rm -r $out 29 + mv patch $out 30 + ${postFetch} 31 + ''; 32 + } 33 + // removeAttrs args [ 34 + "revision" 35 + "postFetch" 36 + "nativeBuildInputs" 37 + "leaveDotGit" 38 + ] 39 + ) 40 + // { 41 + inherit revision; 42 + } 43 + )
+1
pkgs/top-level/all-packages.nix
··· 702 702 fetchFromRepoOrCz = callPackage ../build-support/fetchrepoorcz { }; 703 703 704 704 fetchFromRadicle = callPackage ../build-support/fetchradicle { }; 705 + fetchRadiclePatch = callPackage ../build-support/fetchradiclepatch { }; 705 706 706 707 fetchgx = callPackage ../build-support/fetchgx { }; 707 708