|
| 1 | +# The workbench entrypoint, |
1 | 2 | { pkgs, lib |
2 | | -, cardanoNodeProject |
3 | | -, cardanoNodePackages |
| 3 | + # This provided project attrset will be used all over the workbench instead |
| 4 | + # of the flake's `pkgs` or `cardanoNodePackages`. This allows to easily |
| 5 | + # parametrize the whole build at any point, be it only for the workbench in |
| 6 | + # "nix/pkgs.nix" or when entering a workbench shell in |
| 7 | + # "nix/workbench/shell.nix". |
| 8 | + # Also, by using a haskell.nix project instead of `cardanoNodePackages` or |
| 9 | + # `pkgs` to fetch it's project related dependencies we are sure they are not |
| 10 | + # tagged with the git commit because if we use the `set-git-rev` versions of |
| 11 | + # `cardano-node` and/or `tx-generator` then on every distinct commit ID all |
| 12 | + # the scripts generated by the workbench (start.sh files) will be re-generated |
| 13 | + # instead of obtained from the cache in the nix store. |
| 14 | +, haskellProject |
4 | 15 | }: |
5 | 16 |
|
6 | 17 | with lib; |
|
51 | 62 | ) |
52 | 63 | # Include only the extensions defined above. |
53 | 64 | (lib.any id |
54 | | - (attrValues (mapAttrs |
| 65 | + (lib.attrValues (mapAttrs |
55 | 66 | (dirName: suffixes: |
56 | 67 | (lib.hasPrefix (dirName + "/") relativePath) |
57 | 68 | && |
|
90 | 101 |
|
91 | 102 | profile-names-json = pkgs.runCommand "profile-names.json" {} |
92 | 103 | '' |
93 | | - ${cardanoNodePackages.cardano-profile}/bin/cardano-profile "names" > $out |
| 104 | + ${haskellProject.exes.cardano-profile}/bin/cardano-profile "names" > $out |
94 | 105 | '' |
95 | 106 | ; |
96 | 107 |
|
|
99 | 110 |
|
100 | 111 | in pkgs.lib.fix (self: { |
101 | 112 |
|
102 | | - inherit cardanoNodePackages; |
103 | 113 | inherit workbench; |
| 114 | + inherit haskellProject; |
104 | 115 | inherit profile-names-json profile-names; |
105 | 116 |
|
106 | 117 | # Return a profile attr with a `materialise-profile` function. |
@@ -132,7 +143,9 @@ in pkgs.lib.fix (self: { |
132 | 143 | , profiling |
133 | 144 | }: |
134 | 145 | (backendRegistry."${backendName}") |
135 | | - { inherit pkgs lib stateDir basePort; |
| 146 | + { inherit pkgs lib; |
| 147 | + inherit haskellProject; |
| 148 | + inherit stateDir basePort; |
136 | 149 | # The `useCabalRun` and `profiling` flags are set in the backend to |
137 | 150 | # allow the backend to override its values. The runner must use the |
138 | 151 | # value of these two flags from the backend to prevent having a runner |
@@ -175,7 +188,7 @@ in pkgs.lib.fix (self: { |
175 | 188 | in import ./backend/runner.nix |
176 | 189 | { |
177 | 190 | inherit pkgs lib; |
178 | | - inherit cardanoNodeProject cardanoNodePackages; |
| 191 | + inherit haskellProject; |
179 | 192 | inherit workbench; |
180 | 193 | inherit profile backend; |
181 | 194 | inherit batchName workbenchStartArgs; |
|
0 commit comments