|
126 | 126 | allow-newer: size-based:template-haskell
|
127 | 127 | '';
|
128 | 128 |
|
129 |
| - haskellModules = [( |
130 |
| - { pkgs, ... }: |
131 |
| - { |
132 |
| - packages = { |
133 |
| - marlowe.flags.defer-plugin-errors = true; |
134 |
| - plutus-use-cases.flags.defer-plugin-errors = true; |
135 |
| - plutus-ledger.flags.defer-plugin-errors = true; |
136 |
| - plutus-contract.flags.defer-plugin-errors = true; |
137 |
| - cardano-crypto-praos.components.library.pkgconfig = pkgs.lib.mkForce [ [ pkgs.libsodium-vrf ] ]; |
138 |
| - cardano-crypto-class.components.library.pkgconfig = pkgs.lib.mkForce [ [ pkgs.libsodium-vrf ] ]; |
139 |
| - cardano-wallet-core.components.library.build-tools = [ |
140 |
| - pkgs.buildPackages.buildPackages.gitMinimal |
141 |
| - ]; |
142 |
| - cardano-config.components.library.build-tools = [ |
143 |
| - pkgs.buildPackages.buildPackages.gitMinimal |
144 |
| - ]; |
145 |
| - }; |
146 |
| - } |
147 |
| - )]; |
| 129 | + haskellModules = [ |
| 130 | + ({ pkgs, ... }: |
| 131 | + { |
| 132 | + packages = { |
| 133 | + marlowe.flags.defer-plugin-errors = true; |
| 134 | + plutus-use-cases.flags.defer-plugin-errors = true; |
| 135 | + plutus-ledger.flags.defer-plugin-errors = true; |
| 136 | + plutus-contract.flags.defer-plugin-errors = true; |
| 137 | + cardano-crypto-praos.components.library.pkgconfig = pkgs.lib.mkForce [ [ pkgs.libsodium-vrf ] ]; |
| 138 | + cardano-crypto-class.components.library.pkgconfig = pkgs.lib.mkForce [ [ pkgs.libsodium-vrf ] ]; |
| 139 | + cardano-wallet-core.components.library.build-tools = [ |
| 140 | + pkgs.buildPackages.buildPackages.gitMinimal |
| 141 | + ]; |
| 142 | + cardano-config.components.library.build-tools = [ |
| 143 | + pkgs.buildPackages.buildPackages.gitMinimal |
| 144 | + ]; |
| 145 | + }; |
| 146 | + } |
| 147 | + ) |
| 148 | + ]; |
148 | 149 |
|
149 | 150 | extraSources = [
|
150 | 151 | {
|
|
316 | 317 | let
|
317 | 318 | pkgs = nixpkgsFor system;
|
318 | 319 | pkgs' = nixpkgsFor' system;
|
319 |
| - in pkgs.haskell-nix.cabalProject' { |
| 320 | + in |
| 321 | + pkgs.haskell-nix.cabalProject' { |
320 | 322 | src = ./.;
|
321 | 323 | inherit cabalProjectLocal extraSources;
|
322 | 324 | name = "bot-plutus-interface";
|
|
326 | 328 | ps.plutus-pab
|
327 | 329 | ];
|
328 | 330 | withHoogle = true;
|
329 |
| - tools.haskell-language-server = {}; |
| 331 | + tools.haskell-language-server = { }; |
330 | 332 | exactDeps = true;
|
331 | 333 | nativeBuildInputs = with pkgs'; [
|
332 | 334 | cabal-install
|
|
337 | 339 | jq
|
338 | 340 | websocat
|
339 | 341 | fd
|
| 342 | + nixpkgs-fmt |
340 | 343 | ];
|
341 | 344 | };
|
342 | 345 | modules = haskellModules;
|
343 | 346 | };
|
344 | 347 |
|
345 |
| - in { |
| 348 | + formatCheckFor = system: |
| 349 | + let |
| 350 | + pkgs = nixpkgsFor system; |
| 351 | + in |
| 352 | + pkgs.runCommand "format-check" |
| 353 | + { nativeBuildInputs = [ self.devShell.${system}.nativeBuildInputs ]; } '' |
| 354 | + cd ${self} |
| 355 | + export LC_CTYPE=C.UTF-8 |
| 356 | + export LC_ALL=C.UTF-8 |
| 357 | + export LANG=C.UTF-8 |
| 358 | + export IN_NIX_SHELL='pure' |
| 359 | + make format_check cabalfmt_check nixpkgsfmt_check lint |
| 360 | + mkdir $out |
| 361 | + ''; |
| 362 | + |
| 363 | + in |
| 364 | + { |
346 | 365 | inherit cabalProjectLocal extraSources haskellModules;
|
347 | 366 |
|
348 | 367 | project = perSystem projectFor;
|
|
360 | 379 |
|
361 | 380 | # This will build all of the project's executables and the tests
|
362 | 381 | check = perSystem (system:
|
363 |
| - (nixpkgsFor system).runCommand "combined-check" { |
364 |
| - nativeBuildInputs = builtins.attrValues self.checks.${system} |
365 |
| - ++ builtins.attrValues self.flake.${system}.packages |
366 |
| - ++ [ self.devShell.${system}.inputDerivation self.devShell.${system}.nativeBuildInputs ]; |
367 |
| - } '' |
368 |
| - cd ${self} |
369 |
| - export LC_CTYPE=C.UTF-8 |
370 |
| - export LC_ALL=C.UTF-8 |
371 |
| - export LANG=C.UTF-8 |
372 |
| - export IN_NIX_SHELL='pure' |
373 |
| - make format_check cabalfmt_check nixpkgsfmt_check lint |
374 |
| - mkdir $out |
375 |
| - ''); |
376 |
| - |
| 382 | + (nixpkgsFor system).runCommand "combined-check" |
| 383 | + { |
| 384 | + nativeBuildInputs = builtins.attrValues self.checks.${system} |
| 385 | + ++ builtins.attrValues self.flake.${system}.packages |
| 386 | + ++ [ self.devShell.${system}.inputDerivation ]; |
| 387 | + } "touch $out"); |
377 | 388 | # NOTE `nix flake check` will not work at the moment due to use of
|
378 | 389 | # IFD in haskell.nix
|
379 |
| - checks = perSystem (system: self.flake.${system}.checks); |
| 390 | + checks = perSystem (system: self.flake.${system}.checks // { |
| 391 | + formatCheck = formatCheckFor system; |
| 392 | + }); |
380 | 393 |
|
381 | 394 | herculesCI.ciSystems = [ "x86_64-linux" ];
|
382 | 395 | };
|
|
0 commit comments