Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ callPackage
2, writeTextFile
3}:
4
5let
6 source = callPackage ./source.nix { };
7 deps = callPackage ./deps.nix { };
8in
9rec {
10 resholve = callPackage ./resholve.nix {
11 inherit (source) rSrc version;
12 inherit (deps.oil) oildev;
13 };
14 resholve-utils = callPackage ./resholve-utils.nix {
15 inherit resholve;
16 };
17 resholvePackage = callPackage ./resholve-package.nix {
18 inherit resholve resholve-utils;
19 };
20 resholveScript = name: partialSolution: text:
21 writeTextFile {
22 inherit name text;
23 executable = true;
24 checkPhase = ''
25 (
26 PS4=$'\x1f'"\033[33m[resholve context]\033[0m "
27 set -x
28 ${resholve-utils.makeInvocation name (partialSolution // {
29 scripts = [ "${placeholder "out"}" ];
30 })}
31 )
32 ${partialSolution.interpreter} -n $out
33 '';
34 };
35 resholveScriptBin = name: partialSolution: text:
36 writeTextFile rec {
37 inherit name text;
38 executable = true;
39 destination = "/bin/${name}";
40 checkPhase = ''
41 (
42 cd "$out"
43 PS4=$'\x1f'"\033[33m[resholve context]\033[0m "
44 set -x
45 : changing directory to $PWD
46 ${resholve-utils.makeInvocation name (partialSolution // {
47 scripts = [ "bin/${name}" ];
48 })}
49 )
50 ${partialSolution.interpreter} -n $out/bin/${name}
51 '';
52 };
53}