diff --git a/lib/helpers.nix b/lib/helpers.nix index 5c30f4c628..b4fec303a2 100644 --- a/lib/helpers.nix +++ b/lib/helpers.nix @@ -91,6 +91,13 @@ with lib; rec { }; }; + borderType = with lib.types; + oneOf [ + str + (listOf str) + (listOf (listOf str)) + ]; + # Creates an option with a nullable type that defaults to null. mkNullOrOption = type: desc: lib.mkOption { @@ -146,14 +153,7 @@ with lib; rec { mkEnumFirstDefault = enum: mkEnum enum (head enum); mkBorder = default: name: desc: mkNullable - ( - with lib.types; - oneOf [ - str - (listOf str) - (listOf (listOf str)) - ] - ) + borderType default (let defaultDesc = ''