From 475acf90cb285c7cb3c91d26c8c0005a499b606d Mon Sep 17 00:00:00 2001 From: n3oney Date: Wed, 12 Apr 2023 20:13:30 +0200 Subject: [PATCH] feat: add lib function to quickly mkOption mappings --- lib/stdlib-extended.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/stdlib-extended.nix b/lib/stdlib-extended.nix index 8a9fdb4..d536194 100644 --- a/lib/stdlib-extended.nix +++ b/lib/stdlib-extended.nix @@ -24,6 +24,12 @@ in }; }; + mkMappingOption = description: default: + self.mkOption { + type = self.types.nullOr self.types.str; + inherit default description; + }; + # For forward compatibility. literalExpression = super.literalExpression or super.literalExample; literalDocBook = super.literalDocBook or super.literalExample;