2025-02-19 16:49:58 +07:00
|
|
|
{ lib, ... }:
|
|
|
|
let
|
|
|
|
inherit (lib) types mkOption;
|
|
|
|
|
|
|
|
inherit (types)
|
|
|
|
# attrsOf uses attrsWith internally
|
|
|
|
attrsOf
|
|
|
|
listOf
|
2025-01-19 16:07:39 +01:00
|
|
|
unique
|
2025-02-19 16:49:58 +07:00
|
|
|
;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
# Module A
|
|
|
|
(
|
|
|
|
{ ... }:
|
|
|
|
{
|
|
|
|
options.attrsWith = mkOption {
|
|
|
|
type = attrsOf (listOf types.str);
|
|
|
|
};
|
|
|
|
options.mergedAttrsWith = mkOption {
|
|
|
|
type = attrsOf (listOf types.str);
|
|
|
|
};
|
|
|
|
options.listOf = mkOption {
|
|
|
|
type = listOf (listOf types.str);
|
|
|
|
};
|
|
|
|
options.mergedListOf = mkOption {
|
|
|
|
type = listOf (listOf types.str);
|
|
|
|
};
|
2025-01-19 16:07:39 +01:00
|
|
|
# unique
|
|
|
|
options.unique = mkOption {
|
|
|
|
type = unique { message = ""; } (listOf types.str);
|
|
|
|
};
|
|
|
|
options.mergedUnique = mkOption {
|
|
|
|
type = unique { message = ""; } (listOf types.str);
|
|
|
|
};
|
2025-02-19 16:49:58 +07:00
|
|
|
}
|
|
|
|
)
|
|
|
|
# Module B
|
|
|
|
(
|
|
|
|
{ ... }:
|
|
|
|
{
|
|
|
|
options.mergedAttrsWith = mkOption {
|
|
|
|
type = attrsOf (listOf types.str);
|
|
|
|
};
|
|
|
|
options.mergedListOf = mkOption {
|
|
|
|
type = listOf (listOf types.str);
|
|
|
|
};
|
2025-01-19 16:07:39 +01:00
|
|
|
options.mergedUnique = mkOption {
|
|
|
|
type = unique { message = ""; } (listOf types.str);
|
|
|
|
};
|
2025-02-19 16:49:58 +07:00
|
|
|
}
|
|
|
|
)
|
|
|
|
];
|
|
|
|
}
|