about summary refs log tree commit diff
path: root/nixpkgs/lib/tests/modules/optionTypeMerging.nix
blob: 74a620c4620ca11e8e288070817df2822b7b3083 (plain) (blame)
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
{ config, lib, ... }: {

  options.theType = lib.mkOption {
    type = lib.types.optionType;
  };

  options.theOption = lib.mkOption {
    type = config.theType;
  };

  config.theType = lib.mkMerge [
    (lib.types.submodule {
      options.int = lib.mkOption {
        type = lib.types.int;
        default = 10;
      };
    })
    (lib.types.submodule {
      options.str = lib.mkOption {
        type = lib.types.str;
      };
    })
  ];

  config.theOption.str = "hello";

}