|
10 | 10 | haskellNix.url = "github:input-output-hk/haskell.nix";
|
11 | 11 | hydra-coding-standards.url = "github:cardano-scaling/hydra-coding-standards/0.6.5";
|
12 | 12 | hydra-spec.url = "github:cardano-scaling/hydra-formal-specification/7f78e005b95ff3b9c55995632ceb3d6ab96a305e";
|
| 13 | + import-tree.url = "github:vic/import-tree"; |
13 | 14 | iohk-nix.url = "github:input-output-hk/iohk-nix";
|
14 | 15 | lint-utils = {
|
15 | 16 | url = "github:homotopic/lint-utils";
|
|
22 | 23 | process-compose-flake.url = "github:Platonic-Systems/process-compose-flake";
|
23 | 24 | };
|
24 | 25 |
|
25 |
| - outputs = { self, ... }@inputs: |
26 |
| - inputs.flake-parts.lib.mkFlake { inherit inputs; } { |
27 |
| - imports = [ |
28 |
| - inputs.hydra-coding-standards.flakeModule |
29 |
| - inputs.process-compose-flake.flakeModule |
30 |
| - ./nix/hydra/demo.nix |
31 |
| - ./nix/hydra/docker.nix |
32 |
| - ]; |
33 |
| - systems = [ |
34 |
| - "x86_64-linux" |
35 |
| - "x86_64-darwin" |
36 |
| - "aarch64-darwin" |
37 |
| - "aarch64-linux" |
38 |
| - ]; |
39 |
| - perSystem = { config, lib, system, ... }: |
40 |
| - let |
41 |
| - compiler = "ghc967"; |
42 |
| - |
43 |
| - # nixpkgs enhanced with haskell.nix and crypto libs as used by iohk |
44 |
| - |
45 |
| - pkgs = import inputs.nixpkgs { |
46 |
| - inherit system; |
47 |
| - overlays = [ |
48 |
| - # This overlay contains libsodium and libblst libraries |
49 |
| - inputs.iohk-nix.overlays.crypto |
50 |
| - # This overlay contains pkg-config mappings via haskell.nix to use the |
51 |
| - # crypto libraries above |
52 |
| - inputs.iohk-nix.overlays.haskell-nix-crypto |
53 |
| - # Keep haskell.nix as the last overlay! |
54 |
| - # |
55 |
| - # Reason: haskell.nix modules/overlays needs to be last |
56 |
| - # https://github.com/input-output-hk/haskell.nix/issues/1954 |
57 |
| - inputs.haskellNix.overlay |
58 |
| - # Custom static libs used for darwin build |
59 |
| - (import ./nix/static-libs.nix) |
60 |
| - inputs.nix-npm-buildpackage.overlays.default |
61 |
| - # Specific versions of tools we require |
62 |
| - (final: _prev: { |
63 |
| - inherit (inputs.aiken.packages.${system}) aiken; |
64 |
| - apply-refact = final.haskell-nix.tool compiler "apply-refact" "0.15.0.0"; |
65 |
| - cabal-install = final.haskell-nix.tool compiler "cabal-install" "3.10.3.0"; |
66 |
| - cabal-plan = final.haskell-nix.tool compiler "cabal-plan" { version = "0.7.5.0"; cabalProjectLocal = "package cabal-plan\nflags: +exe"; }; |
67 |
| - cabal-fmt = config.treefmt.programs.cabal-fmt.package; |
68 |
| - fourmolu = config.treefmt.programs.fourmolu.package; |
69 |
| - haskell-language-server = final.haskell-nix.tool compiler "haskell-language-server" "2.11.0.0"; |
70 |
| - weeder = final.haskell-nix.tool compiler "weeder" "2.9.0"; |
71 |
| - inherit (inputs.cardano-node.packages.${system}) cardano-cli; |
72 |
| - inherit (inputs.cardano-node.packages.${system}) cardano-node; |
73 |
| - inherit (inputs.mithril.packages.${system}) mithril-client-cli; |
74 |
| - mithril-client-cli-unstable = |
75 |
| - final.writeShellScriptBin "mithril-client-unstable" '' |
76 |
| - exec ${inputs.mithril-unstable.packages.${system}.mithril-client-cli}/bin/mithril-client "$@" |
77 |
| - ''; |
78 |
| - }) |
79 |
| - ]; |
80 |
| - }; |
81 |
| - |
82 |
| - inputMap = { "https://intersectmbo.github.io/cardano-haskell-packages" = inputs.CHaP; }; |
83 |
| - |
84 |
| - hsPkgs = import ./nix/hydra/project.nix { |
85 |
| - inherit pkgs inputMap; |
86 |
| - compiler-nix-name = compiler; |
87 |
| - }; |
88 |
| - |
89 |
| - hydraPackages = import ./nix/hydra/packages.nix { |
90 |
| - inherit pkgs inputs hsPkgs self; |
91 |
| - gitRev = self.rev or "dirty"; |
92 |
| - }; |
93 |
| - |
94 |
| - tx-cost-diff = |
95 |
| - pkgs.writers.writeHaskellBin |
96 |
| - "tx-cost-diff" |
97 |
| - { |
98 |
| - libraries = |
99 |
| - with pkgs.haskellPackages; |
100 |
| - [ aeson text bytestring lens lens-aeson shh ]; |
101 |
| - } ''${builtins.readFile scripts/tx-cost-diff.hs}''; |
102 |
| - |
103 |
| - allComponents = x: |
104 |
| - [ x.components.library ] |
105 |
| - ++ lib.concatMap |
106 |
| - (y: builtins.attrValues x.components."${y}") |
107 |
| - [ "benchmarks" "exes" "sublibs" "tests" ]; |
108 |
| - in |
109 |
| - { |
110 |
| - |
111 |
| - _module.args = { inherit pkgs; }; |
112 |
| - |
113 |
| - legacyPackages = pkgs // hsPkgs; |
114 |
| - |
115 |
| - packages = |
116 |
| - hydraPackages // |
117 |
| - { |
118 |
| - spec = inputs.hydra-spec.packages.${system}.default; |
119 |
| - inherit tx-cost-diff; |
120 |
| - }; |
121 |
| - |
122 |
| - coding.standards.hydra = { |
123 |
| - enable = true; |
124 |
| - haskellPackages = with hsPkgs; builtins.concatMap allComponents [ |
125 |
| - hydra-cardano-api |
126 |
| - hydra-chain-observer |
127 |
| - hydra-cluster |
128 |
| - hydra-node |
129 |
| - hydra-tx |
130 |
| - hydra-prelude |
131 |
| - hydra-plutus |
132 |
| - hydra-plutus-extras |
133 |
| - hydra-test-utils |
134 |
| - hydra-tui |
135 |
| - hydraw |
136 |
| - ]; |
137 |
| - inherit (pkgs) weeder; |
138 |
| - haskellType = "haskell.nix"; |
139 |
| - }; |
140 |
| - |
141 |
| - devShells = import ./nix/hydra/shell.nix { |
142 |
| - inherit pkgs hsPkgs hydraPackages system; |
143 |
| - ghc = pkgs.buildPackages.haskell-nix.compiler.${compiler}; |
144 |
| - }; |
145 |
| - }; |
146 |
| - }; |
| 26 | + outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./nix); |
147 | 27 |
|
148 | 28 | nixConfig = {
|
149 | 29 | extra-substituters = [
|
|
0 commit comments