about summary refs log tree commit diff
path: root/nixpkgs/lib/tests/modules/extendModules-168767-imports.nix
blob: 6b50b81236d17a48dbb5679aa3eb2f5a63386b74 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{ lib
, extendModules
, ...
}:

let
  inherit (lib)
    mkOption
    mkOverride
    types
    ;
in
{
  imports = [

    {
      options.sub = mkOption {
        default = { };
        type = types.submodule (
          { config
          , extendModules
          , ...
          }:
          {
            options.value = mkOption {
              type = types.int;
            };

            options.specialisation = mkOption {
              default = { };
              inherit
                (extendModules {
                  modules = [{
                    specialisation = mkOverride 0 { };
                  }];
                })
                type;
            };
          }
        );
      };
    }

    { config.sub.value = 1; }


  ];
}