|
1 |
| -{ lib, flake-parts-lib, ... }: |
2 |
| -let |
| 1 | +{ |
| 2 | + lib, |
| 3 | + flake-parts-lib, |
| 4 | + ... |
| 5 | +}: let |
3 | 6 | inherit (flake-parts-lib) mkPerSystemOption;
|
4 | 7 | inherit (lib) types;
|
5 |
| - |
6 |
| -in |
7 |
| -{ |
| 8 | +in { |
8 | 9 | _file = ./valence-contracts.nix;
|
9 | 10 | imports = [
|
10 | 11 | # Can't use zero-nix.flakeModules.upload-contracts, because it causes
|
|
13 | 14 | ];
|
14 | 15 |
|
15 | 16 | options.perSystem = mkPerSystemOption (
|
16 |
| - { config, system, options, ... }: |
17 |
| - let |
18 |
| - cfg = config.valence-contracts; |
19 |
| - in |
20 | 17 | {
|
| 18 | + config, |
| 19 | + system, |
| 20 | + options, |
| 21 | + ... |
| 22 | + }: let |
| 23 | + cfg = config.valence-contracts; |
| 24 | + in { |
21 | 25 | options.valence-contracts.upload = lib.mkEnableOption ''
|
22 | 26 | Setup all valence contracts from latest stable release to be uploaded.
|
23 | 27 | '';
|
|
36 | 40 | Valence contract builds to add to packages output.
|
37 | 41 | '';
|
38 | 42 | default = {};
|
39 |
| - type = types.attrsOf (types.submodule ({ name, ... }: { |
| 43 | + type = types.attrsOf (types.submodule ({name, ...}: { |
40 | 44 | options = {
|
41 | 45 | src = lib.mkOption {
|
42 | 46 | type = types.path;
|
|
86 | 90 | upload-contracts.default-inputs = {
|
87 | 91 | inherit (cfg.default-inputs) cosmos-nix zero-nix;
|
88 | 92 | };
|
89 |
| - upload-contracts.network-defaults.chain-defaults = { config, ... }: { |
| 93 | + upload-contracts.network-defaults.chain-defaults = {config, ...}: { |
90 | 94 | contracts = lib.mkMerge [
|
91 | 95 | # Contract paths are inferred based on name
|
92 | 96 | # but can be manually set with the `path` option within each contract
|
|
101 | 105 | valence_astroport_withdrawer = {};
|
102 | 106 | valence_generic_ibc_transfer_library = {};
|
103 | 107 | }
|
| 108 | + (lib.mkIf (config.package.pname == "osmosis") { |
| 109 | + valence_osmosis_cl_lper = {}; |
| 110 | + valence_osmosis_cl_withdrawer = {}; |
| 111 | + valence_osmosis_gamm_lper = {}; |
| 112 | + valence_osmosis_gamm_withdrawer = {}; |
| 113 | + }) |
104 | 114 | (lib.mkIf (config.package.pname == "neutron") {
|
105 | 115 | # All contracts that are specific to neutron
|
106 | 116 | valence_authorization = {};
|
|
113 | 123 | };
|
114 | 124 | })
|
115 | 125 | {
|
116 |
| - packages = lib.mapAttrs' (name: buildAttrs: { |
117 |
| - name = "valence-contracts-${buildAttrs.version}"; |
118 |
| - value = cfg.default-inputs.zero-nix.tools.${system}.buildValenceContracts buildAttrs; |
119 |
| - }) config.valence-contracts.builds; |
| 126 | + packages = |
| 127 | + lib.mapAttrs' (name: buildAttrs: { |
| 128 | + name = "valence-contracts-${buildAttrs.version}"; |
| 129 | + value = cfg.default-inputs.zero-nix.tools.${system}.buildValenceContracts buildAttrs; |
| 130 | + }) |
| 131 | + config.valence-contracts.builds; |
120 | 132 | }
|
121 | 133 | ];
|
122 |
| - }); |
| 134 | + } |
| 135 | + ); |
123 | 136 | }
|
0 commit comments