mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 19:55:41 +03:00
55 lines
1.2 KiB
Nix
55 lines
1.2 KiB
Nix
{ lib, ... }:
|
|
let
|
|
inherit (lib) types mkOption;
|
|
|
|
inherit (types)
|
|
# attrsOf uses attrsWith internally
|
|
attrsOf
|
|
listOf
|
|
unique
|
|
;
|
|
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);
|
|
};
|
|
# unique
|
|
options.unique = mkOption {
|
|
type = unique { message = ""; } (listOf types.str);
|
|
};
|
|
options.mergedUnique = mkOption {
|
|
type = unique { message = ""; } (listOf types.str);
|
|
};
|
|
}
|
|
)
|
|
# Module B
|
|
(
|
|
{ ... }:
|
|
{
|
|
options.mergedAttrsWith = mkOption {
|
|
type = attrsOf (listOf types.str);
|
|
};
|
|
options.mergedListOf = mkOption {
|
|
type = listOf (listOf types.str);
|
|
};
|
|
options.mergedUnique = mkOption {
|
|
type = unique { message = ""; } (listOf types.str);
|
|
};
|
|
}
|
|
)
|
|
];
|
|
}
|