summaryrefslogtreecommitdiff
path: root/lib/tests/modules/option.nix
blob: 43cef14aee2b4b72e0d61977acd2194687e627a4 (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
{
  config,
  lib,
  options,
  ...
}:
{
  options = {
    theOption = lib.mkOption {
      type = lib.types.optionDeclaration;
    };
    anOption = config.theOption;
    aBadOptionDef = lib.mkOption {
      type = lib.types.optionDeclaration;
      description = ''
        This option is perfectly fine, but will have a bad definition.
      '';
    };
  };
  config = {
    theOption = lib.mkOption {
      type = lib.types.int;
    };
    anOption = 10;
    aBadOptionDef = options.theOption; # Not a declaration
  };
}