|
31 | 31 | let
|
32 | 32 | pkgs = import nixpkgs {
|
33 | 33 | inherit system;
|
34 |
| - overlays = [ |
35 |
| - (import ./nix/build_overlay.nix) |
36 |
| - poetry2nix.overlays.default |
37 |
| - gomod2nix.overlays.default |
38 |
| - self.overlay |
39 |
| - ]; |
| 34 | + overlays = self.overlays.default; |
40 | 35 | config = { };
|
41 | 36 | };
|
42 | 37 | in
|
|
73 | 68 | }
|
74 | 69 | )
|
75 | 70 | ) // {
|
76 |
| - overlay = final: super: { |
77 |
| - go = super.go_1_22; |
78 |
| - test-env = final.callPackage ./nix/testenv.nix { }; |
79 |
| - bundle-exe = final.pkgsBuildBuild.callPackage nix-bundle-exe { }; |
80 |
| - # make-tarball don't follow symbolic links to avoid duplicate file, the bundle should have no external references. |
81 |
| - # reset the ownership and permissions to make the extract result more normal. |
82 |
| - make-tarball = drv: final.runCommand "tarball-${drv.name}" |
83 |
| - { |
84 |
| - nativeBuildInputs = with final.buildPackages; [ gnutar gzip ]; |
85 |
| - } '' |
86 |
| - tar cfv - -C "${drv}" \ |
87 |
| - --owner=0 --group=0 --mode=u+rw,uga+r --hard-dereference . \ |
88 |
| - | gzip -9 > $out |
89 |
| - ''; |
90 |
| - bundle-win-exe = drv: final.callPackage ./nix/bundle-win-exe.nix { cronosd = drv; }; |
91 |
| - } // (with final; |
92 |
| - let |
93 |
| - matrix = lib.cartesianProductOfSets { |
94 |
| - network = [ "mainnet" "testnet" ]; |
95 |
| - pkgtype = [ |
96 |
| - "nix" # normal nix package |
97 |
| - "bundle" # relocatable bundled package |
98 |
| - "tarball" # tarball of the bundle, for distribution and checksum |
99 |
| - ]; |
| 71 | + overlays.default = [ |
| 72 | + (import ./nix/build_overlay.nix) |
| 73 | + poetry2nix.overlays.default |
| 74 | + gomod2nix.overlays.default |
| 75 | + (final: super: { |
| 76 | + go = super.go_1_22; |
| 77 | + test-env = final.callPackage ./nix/testenv.nix { }; |
| 78 | + cronos-matrix = final.callPackage ./nix/cronos-matrix.nix { |
| 79 | + bundle-exe = final.pkgsBuildBuild.callPackage nix-bundle-exe { }; |
100 | 80 | };
|
101 |
| - binaries = builtins.listToAttrs (builtins.map |
102 |
| - ({ network, pkgtype }: { |
103 |
| - name = builtins.concatStringsSep "-" ( |
104 |
| - [ "cronosd" ] ++ |
105 |
| - lib.optional (network != "mainnet") network ++ |
106 |
| - lib.optional (pkgtype != "nix") pkgtype |
107 |
| - ); |
108 |
| - value = |
109 |
| - let |
110 |
| - cronosd = callPackage ./. { |
111 |
| - inherit rev network; |
112 |
| - }; |
113 |
| - bundle = |
114 |
| - if stdenv.hostPlatform.isWindows then |
115 |
| - bundle-win-exe cronosd |
116 |
| - else |
117 |
| - bundle-exe cronosd; |
118 |
| - in |
119 |
| - if pkgtype == "bundle" then |
120 |
| - bundle |
121 |
| - else if pkgtype == "tarball" then |
122 |
| - make-tarball bundle |
123 |
| - else |
124 |
| - cronosd; |
125 |
| - }) |
126 |
| - matrix |
127 |
| - ); |
128 |
| - in |
129 |
| - { |
130 |
| - cronos-matrix = binaries; |
131 |
| - } |
132 |
| - ); |
| 81 | + }) |
| 82 | + ]; |
133 | 83 | };
|
134 | 84 | }
|
0 commit comments