From a4526cc8c3027a173268423900944f4c15640964 Mon Sep 17 00:00:00 2001 From: Jaka Hudoklin Date: Fri, 6 Apr 2018 18:48:23 +0200 Subject: [PATCH] fix(kubernetes): allow merging options if strings are equal --- kubernetes.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/kubernetes.nix b/kubernetes.nix index 43a8c5e..9a13614 100644 --- a/kubernetes.nix +++ b/kubernetes.nix @@ -12,11 +12,18 @@ let hasAttr "type" def && elem def.type ["string" "integer" "boolean" "object"]; + str = mkOptionType { + name = "str"; + description = "string"; + check = isString; + merge = mergeEqualOption; + }; + mapType = def: if def.type == "string" then if hasAttr "format" def && def.format == "int-or-string" - then types.either types.int types.str - else types.str + then types.either types.int str + else str else if def.type == "integer" then types.int else if def.type == "boolean" then types.bool else if def.type == "object" then types.attrs