From 9bf7724b98250aeca9d4c478c8035594f813ccd6 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Fri, 31 May 2024 18:41:49 +0100 Subject: [PATCH] lib/options: add `mkCompositeOption'` variant --- lib/options.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/options.nix b/lib/options.nix index d8d268e7..070c22c9 100644 --- a/lib/options.nix +++ b/lib/options.nix @@ -22,7 +22,12 @@ rec { ); mkNullOrOption = type: description: mkNullOrOption' { inherit type description; }; - mkCompositeOption = desc: options: mkNullOrOption (types.submodule { inherit options; }) desc; + mkCompositeOption' = + { options, ... }@args: + mkNullOrOption' ( + (filterAttrs (n: _: n != "options") args) // { type = types.submodule { inherit options; }; } + ); + mkCompositeOption = description: options: mkCompositeOption' { inherit description options; }; mkNullOrStr = mkNullOrOption (with nixvimTypes; maybeRaw str);