core/lib/tests/modules/extendModules-168767-imports.nix

30 lines
576 B
Nix
Raw Normal View History

2024-06-30 08:16:52 +00:00
{ lib, extendModules, ... }:
2024-05-01 22:14:04 +00:00
let
2024-06-30 08:16:52 +00:00
inherit (lib) mkOption mkOverride types;
2024-05-01 22:14:04 +00:00
in
{
imports = [
{
options.sub = mkOption {
default = { };
type = types.submodule (
2024-06-30 08:16:52 +00:00
{ config, extendModules, ... }:
2024-05-01 22:14:04 +00:00
{
2024-06-30 08:16:52 +00:00
options.value = mkOption { type = types.int; };
2024-05-01 22:14:04 +00:00
options.specialisation = mkOption {
default = { };
2024-06-30 08:16:52 +00:00
inherit (extendModules { modules = [ { specialisation = mkOverride 0 { }; } ]; }) type;
2024-05-01 22:14:04 +00:00
};
}
);
};
}
{ config.sub.value = 1; }
];
}