From 43f3cb7ab2bae6c27a92f306c27e053ef2cb0063 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 25 Jan 2024 16:17:36 +0100 Subject: [PATCH] lib/helpers: init neovim-plugin.mkSetupOptionsOption --- lib/neovim-plugin.nix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/neovim-plugin.nix b/lib/neovim-plugin.nix index 38667c8d..5bab9b7c 100644 --- a/lib/neovim-plugin.nix +++ b/lib/neovim-plugin.nix @@ -3,6 +3,27 @@ nixvimOptions, }: with lib; { + mkSetupOptionsOption = pluginName: options: { + type = with types; + submodule { + freeformType = with types; attrsOf anything; + inherit options; + }; + description = '' + Options provided to the `require('${pluginName}').setup` function. + ''; + default = {}; + example = { + foo_bar = 42; + hostname = "localhost:8080"; + callback.__raw = '' + function() + print('nixvim') + end + ''; + }; + }; + extraOptionsOptions = { extraOptions = mkOption { default = {};