lol

build-support: Add fetchpijul function.

+58
+56
pkgs/build-support/fetchpijul/default.nix
··· 1 + { lib, stdenvNoCC, pijul }: 2 + 3 + lib.makeOverridable ( 4 + { url 5 + , hash ? "" 6 + , change ? null 7 + , state ? null 8 + , channel ? "main" 9 + , name ? "fetchpijul" 10 + , # TODO: Changes in pijul are unordered so there's many ways to end up with the same repository state. 11 + # This makes leaveDotPijul unfeasible to implement until pijul CLI implements 12 + # a way of reordering changes to sort them in a consistent and deterministic manner. 13 + # leaveDotPijul ? false 14 + }: 15 + if change != null && state != null then 16 + throw "Only one of 'change' or 'state' can be set" 17 + else 18 + stdenvNoCC.mkDerivation { 19 + inherit name; 20 + nativeBuildInputs = [ pijul ]; 21 + 22 + dontUnpack = true; 23 + dontConfigure = true; 24 + dontBuild = true; 25 + 26 + installPhase = '' 27 + runHook preInstall 28 + 29 + pijul clone \ 30 + ''${change:+--change "$change"} \ 31 + ''${state:+--state "$state"} \ 32 + --channel "$channel" \ 33 + "$url" \ 34 + "$out" 35 + 36 + runHook postInstall 37 + ''; 38 + 39 + fixupPhase = '' 40 + runHook preFixup 41 + 42 + rm -rf "$out/.pijul" 43 + 44 + runHook postFixup 45 + ''; 46 + 47 + outputHashAlgo = if hash != "" then null else "sha256"; 48 + outputHashMode = "recursive"; 49 + outputHash = if hash != "" then 50 + hash 51 + else 52 + lib.fakeSha256; 53 + 54 + inherit url change state channel; 55 + } 56 + )
+2
pkgs/top-level/all-packages.nix
··· 899 899 900 900 fetchMavenArtifact = callPackage ../build-support/fetchmavenartifact { }; 901 901 902 + fetchpijul = callPackage ../build-support/fetchpijul { }; 903 + 902 904 inherit (callPackage ../build-support/node/fetch-yarn-deps { }) 903 905 prefetch-yarn-deps 904 906 fetchYarnDeps;