mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 13:40:28 +03:00
lib.types.optionType: Only merge when necessary
This commit is contained in:
parent
87fce11f62
commit
55ee7ab4a6
3 changed files with 20 additions and 1 deletions
|
@ -535,7 +535,9 @@ rec {
|
|||
description = "optionType";
|
||||
check = value: value._type or null == "option-type";
|
||||
merge = loc: defs:
|
||||
let
|
||||
if length defs == 1
|
||||
then (head defs).value
|
||||
else let
|
||||
# Prepares the type definitions for mergeOptionDecls, which
|
||||
# annotates submodules types with file locations
|
||||
optionModules = map ({ value, file }:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue