|
3 | 3 | ... |
4 | 4 | }@args: |
5 | 5 | let |
6 | | - inherit (lib.types) |
7 | | - submodule |
| 6 | + inherit (lib) |
| 7 | + types |
| 8 | + mkOption |
8 | 9 | ; |
| 10 | + |
| 11 | + submodule = |
| 12 | + modules: |
| 13 | + types.submodule { |
| 14 | + imports = [ |
| 15 | + { |
| 16 | + config._module.args = args // { |
| 17 | + ngiTypes = options.ngiTypes.default; |
| 18 | + }; |
| 19 | + } |
| 20 | + ] |
| 21 | + ++ lib.toList modules; |
| 22 | + }; |
| 23 | + |
| 24 | + options.ngiTypes = mkOption { |
| 25 | + type = with types; attrs; |
| 26 | + default = { |
| 27 | + binary = submodule ./binary.nix; |
| 28 | + demo = submodule ./demo.nix; |
| 29 | + example = submodule ./example.nix; |
| 30 | + link = submodule ./link.nix; |
| 31 | + metadata = submodule ./metadata.nix; |
| 32 | + problem = import ./problem.nix args; |
| 33 | + program = submodule (import ./module.nix { type = "program"; }); |
| 34 | + plugin = submodule ./plugin.nix; |
| 35 | + project = submodule ./project.nix; |
| 36 | + projects = mkOption { |
| 37 | + type = with types; attrsOf (submodule ./project.nix); |
| 38 | + description = "NGI-funded software application"; |
| 39 | + }; |
| 40 | + service = submodule (import ./module.nix { type = "service"; }); |
| 41 | + subgrant = submodule ./subgrant.nix; |
| 42 | + test = submodule ./test.nix; |
| 43 | + }; |
| 44 | + description = ""; |
| 45 | + }; |
9 | 46 | in |
10 | 47 | { |
11 | | - binary = submodule ./binary.nix; |
12 | | - demo = submodule ./demo.nix; |
13 | | - example = submodule ./example.nix; |
14 | | - link = submodule ./link.nix; |
15 | | - metadata = submodule ./metadata.nix; |
16 | | - problem = import ./problem.nix args; |
17 | | - program = submodule (import ./module.nix { type = "program"; }); |
18 | | - plugin = submodule ./plugin.nix; |
19 | | - project = submodule ./project.nix; |
20 | | - service = submodule (import ./module.nix { type = "service"; }); |
21 | | - subgrant = submodule ./subgrant.nix; |
22 | | - test = submodule ./test.nix; |
| 48 | + inherit options; |
23 | 49 | } |
0 commit comments