aboutsummaryrefslogtreecommitdiff
path: root/tests/modules/declare-submoduleWith-modules.nix
blob: a8b82d176881b0f66a1ed88fc411e2e773813a87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{ lib, ... }: {
  options.submodule = lib.mkOption {
    type = lib.types.submoduleWith {
      modules = [
        {
          options.inner = lib.mkOption {
            type = lib.types.bool;
            default = false;
          };
        }
      ];
    };
    default = {};
  };

  config.submodule = lib.mkMerge [
    ({ lib, ... }: {
      options.outer = lib.mkOption {
        type = lib.types.bool;
        default = false;
      };
    })
    {
      inner = true;
      outer = true;
    }
  ];
}