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