|
103 | 103 | # - the CLI application (`lbf-prelude-to-haskell`) to compile `.lbf` |
104 | 104 | # schemas |
105 | 105 | let |
106 | | - project = { lib, ... }: { |
| 106 | + hsFlake = config.lbf-nix.haskellFlake { |
107 | 107 | src = config.packages.lbf-prelude-haskell; |
108 | 108 |
|
109 | 109 | name = "dev-prelude-haskell"; |
110 | 110 |
|
111 | 111 | inherit (config.settings.haskell) index-state compiler-nix-name; |
112 | 112 |
|
113 | | - extraHackage = [ |
| 113 | + dependencies = [ |
114 | 114 | "${config.packages.lbr-prelude-haskell-src}" |
115 | 115 | "${config.packages.lbf-prelude-haskell}" |
116 | 116 | ]; |
| 117 | + # Note: Add `lbf-prelude` Haskell package in the devShell environment. |
| 118 | + # This *must* be the name of the autogenerated cabal package from |
| 119 | + # `lbf-prelude-haskell` |
| 120 | + devShellAdditionalPackages = ps: [ ps.lbf-prelude ]; |
117 | 121 |
|
118 | | - modules = [ |
119 | | - (_: { |
120 | | - packages = { |
121 | | - allComponent.doHoogle = true; |
122 | | - allComponent.doHaddock = true; |
123 | | - }; |
124 | | - }) |
125 | | - ]; |
126 | | - |
127 | | - shell = { |
128 | | - |
129 | | - withHoogle = true; |
130 | | - |
131 | | - exactDeps = true; |
132 | | - |
133 | | - nativeBuildInputs = config.settings.shell.tools |
134 | | - ++ [ config.packages.lbf-prelude-to-haskell ]; |
135 | | - |
136 | | - # Note: the `additional` (contrast to `packages`) attribute |
137 | | - # includes the dependencies + the package itself. See: |
138 | | - # https://input-output-hk.github.io/haskell.nix/reference/library.html#shellfor |
139 | | - # This *must* be the name of the autogenerated cabal package from |
140 | | - # `lbf-prelude-haskell` |
141 | | - additional = ps: [ ps.lbf-prelude ]; |
142 | | - |
143 | | - tools = { |
144 | | - cabal = { }; |
145 | | - haskell-language-server = { }; |
146 | | - }; |
147 | | - |
148 | | - shellHook = lib.mkForce config.settings.shell.hook; |
149 | | - }; |
| 122 | + devShellTools = config.settings.shell.tools ++ [ config.packages.lbf-prelude-to-haskell ]; |
| 123 | + devShellHook = config.settings.shell.hook; |
150 | 124 | }; |
151 | | - hsNixFlake = (pkgs.haskell-nix.cabalProject' [ |
152 | | - inputs.mlabs-tooling.lib.mkHackageMod |
153 | | - inputs.mlabs-tooling.lib.moduleMod |
154 | | - project |
155 | | - ]).flake { }; |
156 | 125 | in |
157 | | - hsNixFlake.devShell; |
| 126 | + hsFlake.devShell; |
158 | 127 |
|
159 | 128 | dev-plutustx = |
160 | 129 | # Note: |
|
170 | 139 | # Note: |
171 | 140 | # This is mostly duplicated code from `dev-prelude-haskell` |
172 | 141 | let |
173 | | - project = { lib, ... }: { |
| 142 | + hsFlake = config.lbf-nix.haskellPlutusFlake { |
174 | 143 | src = config.packages.lbf-plutus-haskell; |
175 | 144 |
|
176 | 145 | name = "dev-plutustx"; |
177 | 146 |
|
178 | 147 | inherit (config.settings.haskell) index-state compiler-nix-name; |
179 | 148 |
|
180 | | - extraHackage = [ |
| 149 | + dependencies = [ |
181 | 150 | "${config.packages.lbr-prelude-haskell-src}" |
182 | 151 | "${config.packages.lbf-prelude-haskell}" |
183 | 152 | "${config.packages.lbr-plutus-haskell-src}" |
184 | 153 | "${config.packages.lbf-plutus-haskell}" |
185 | 154 | ]; |
186 | | - |
187 | | - modules = [ |
188 | | - (_: { |
189 | | - packages = { |
190 | | - allComponent.doHoogle = true; |
191 | | - allComponent.doHaddock = true; |
192 | | - }; |
193 | | - }) |
| 155 | + # Note: Add `lbf-prelude` and `lbf-plutus` Haskell packages in the devShell environment. |
| 156 | + # This *must* be the name of the autogenerated cabal package from |
| 157 | + # `lbf-prelude-haskell` and `lbf-plutus-haskell` |
| 158 | + devShellAdditionalPackages = ps: [ ps.lbf-prelude ps.lbf-plutus ]; |
| 159 | + |
| 160 | + devShellTools = config.settings.shell.tools ++ [ |
| 161 | + # We include both the Prelude and Plutus |
| 162 | + # frontend. Perhaps, we should _only_ include the |
| 163 | + # Plutus frontend, but it doesn't hurt to include both. |
| 164 | + config.packages.lbf-prelude-to-haskell |
| 165 | + config.packages.lbf-plutus-to-haskell |
194 | 166 | ]; |
195 | 167 |
|
196 | | - shell = { |
197 | | - |
198 | | - withHoogle = true; |
199 | | - |
200 | | - exactDeps = true; |
201 | | - |
202 | | - nativeBuildInputs = config.settings.shell.tools |
203 | | - ++ [ |
204 | | - # We include both the Prelude and Plutus |
205 | | - # frontend. Perhaps, we should _only_ include the |
206 | | - # Plutus frontend, but it doesn't hurt to include both. |
207 | | - config.packages.lbf-prelude-to-haskell |
208 | | - config.packages.lbf-plutus-to-haskell |
209 | | - ]; |
210 | | - |
211 | | - additional = ps: [ ps.lbf-plutus ]; |
212 | | - |
213 | | - tools = { |
214 | | - cabal = { }; |
215 | | - haskell-language-server = { }; |
216 | | - }; |
217 | | - |
218 | | - shellHook = lib.mkForce config.settings.shell.hook; |
219 | | - }; |
| 168 | + devShellHook = config.settings.shell.hook; |
220 | 169 | }; |
221 | | - hsNixFlake = (pkgs.haskell-nix.cabalProject' [ |
222 | | - inputs.mlabs-tooling.lib.mkHackageMod |
223 | | - inputs.mlabs-tooling.lib.moduleMod |
224 | | - project |
225 | | - ]).flake { }; |
226 | 170 | in |
227 | | - hsNixFlake.devShell; |
| 171 | + hsFlake.devShell; |
228 | 172 |
|
229 | 173 | dev-plutarch = |
230 | 174 | let |
231 | | - project = { lib, ... }: { |
| 175 | + hsFlake = config.lbf-nix.haskellPlutusFlake { |
232 | 176 | src = config.packages.lbf-plutus-plutarch; |
233 | 177 |
|
234 | 178 | name = "dev-plutarch"; |
235 | 179 |
|
236 | 180 | inherit (config.settings.haskell) index-state compiler-nix-name; |
237 | 181 |
|
238 | | - extraHackage = [ |
| 182 | + dependencies = [ |
239 | 183 | # Load Plutarch support (Prelude, Plutus) |
240 | 184 | "${config.packages.lbf-prelude-plutarch}" |
241 | 185 | "${config.packages.lbf-plutus-plutarch}" |
|
249 | 193 | "${inputs.plutarch}" |
250 | 194 | "${inputs.plutarch}/plutarch-extra" |
251 | 195 | ]; |
252 | | - |
253 | | - modules = [ |
254 | | - (_: { |
255 | | - packages = { |
256 | | - #allComponent.doHoogle = true; |
257 | | - #allComponent.doHaddock = true; |
258 | | - |
259 | | - # lbf-prelude.configureFlags = [ "-f-dev" ]; |
260 | | - }; |
261 | | - }) |
| 196 | + devShellAdditionalPackages = ps: [ |
| 197 | + ps.lbf-prelude-plutarch |
| 198 | + ps.lbf-plutus-plutarch |
| 199 | + ps.lbr-plutarch |
| 200 | + ps.plutus-tx |
| 201 | + ps.plutus-ledger-api |
262 | 202 | ]; |
263 | 203 |
|
264 | | - shell = { |
265 | | - |
266 | | - withHoogle = true; |
267 | | - |
268 | | - exactDeps = true; |
269 | | - |
270 | | - nativeBuildInputs = config.settings.shell.tools ++ [ |
271 | | - config.packages.lbf-plutus-to-plutarch |
272 | | - config.packages.lbf-prelude-to-haskell |
273 | | - config.packages.lbf-plutus-to-haskell |
274 | | - ]; |
275 | | - |
276 | | - additional = ps: [ |
277 | | - ps.lbf-prelude-plutarch |
278 | | - ps.lbf-plutus-plutarch |
279 | | - ps.lbr-plutarch |
280 | | - ps.plutus-tx |
281 | | - ps.plutus-ledger-api |
282 | | - ]; |
283 | | - |
284 | | - tools = { |
285 | | - cabal = { }; |
286 | | - haskell-language-server = { }; |
287 | | - }; |
| 204 | + devShellTools = config.settings.shell.tools ++ [ |
| 205 | + config.packages.lbf-plutus-to-plutarch |
| 206 | + config.packages.lbf-prelude-to-haskell |
| 207 | + config.packages.lbf-plutus-to-haskell |
| 208 | + ]; |
288 | 209 |
|
289 | | - shellHook = lib.mkForce config.settings.shell.hook; |
290 | | - }; |
| 210 | + devShellHook = config.settings.shell.hook; |
291 | 211 | }; |
292 | | - hsNixFlake = (pkgs.haskell-nix.cabalProject' [ |
293 | | - inputs.mlabs-tooling.lib.mkHackageMod |
294 | | - inputs.mlabs-tooling.lib.moduleMod |
295 | | - project |
296 | | - ]).flake { }; |
297 | 212 | in |
298 | | - hsNixFlake.devShell; |
299 | | - |
| 213 | + hsFlake.devShell; |
300 | 214 | }; |
301 | 215 | }; |
302 | 216 | } |
|
0 commit comments