summaryrefslogtreecommitdiff
path: root/lib/tests/modules/optionTypeFile.nix
blob: d3e0b9e6817e04095ff0cc48384e93d73ab24bd0 (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
29
{ config, lib, ... }:
{

  _file = "optionTypeFile.nix";

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

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

  config.theType = lib.mkMerge [
    (lib.types.submodule {
      options.nested = lib.mkOption {
        type = lib.types.int;
      };
    })
    (lib.types.submodule {
      _file = "other.nix";
      options.nested = lib.mkOption {
        type = lib.types.str;
      };
    })
  ];

}