From 023fa7b9239e645f7dfcbbe3ee82ab0093f9978d Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Wed, 8 Dec 2021 19:13:14 +0100 Subject: lib.modules: Use types.optionType for _module.freeformType This ensures that the module file locations are propagated to the freeform type, which makes it so that submodules in freeform types now have their declaration location shown in the manual, fixing https://github.com/NixOS/nixpkgs/issues/132085. In addition, this also newly allows freeformTypes to be declared multiple times and all declarations being merged together according to normal option merging. This also removes some awkwardness regarding the type of `freeformType` --- lib/modules.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/modules.nix') diff --git a/lib/modules.nix b/lib/modules.nix index e9fc1007fc2..79d54e4a538 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -151,8 +151,7 @@ rec { }; _module.freeformType = mkOption { - # Disallow merging for now, but could be implemented nicely with a `types.optionType` - type = types.nullOr (types.uniq types.attrs); + type = types.nullOr types.optionType; internal = true; default = null; description = '' -- cgit 1.4.1