From 43ce0d77dbc4db5b0e6807f66349c940cd80bfdf Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Wed, 10 Feb 2021 21:03:30 +0000 Subject: [PATCH] helpers: add a helper for creating options --- plugins/helpers.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/helpers.nix b/plugins/helpers.nix index c2a54dd5..eb505cb9 100644 --- a/plugins/helpers.nix +++ b/plugins/helpers.nix @@ -51,4 +51,11 @@ rec { key = key; mode = mode; }) normalized); + + # Creates an option with a nullable type that defaults to null. + nullOrOption = type: desc: lib.mkOption { + type = lib.types.nullOr type; + default = null; + description = desc; + }; }