From 2319ee082c3152ceaf74b10cdd3f0d531719198f Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Tue, 18 Jul 2023 22:21:36 +0300 Subject: [PATCH] dev: custom type for extraPlugin module --- lib/types/default.nix | 2 +- lib/types/plugins.nix | 19 +++++++++++++++++++ modules/core/default.nix | 5 +++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/lib/types/default.nix b/lib/types/default.nix index 6d5777d..bfaa38d 100644 --- a/lib/types/default.nix +++ b/lib/types/default.nix @@ -4,6 +4,6 @@ typesLanguage = import ./languages.nix {inherit lib;}; in { inherit (typesDag) dagOf; - inherit (typesPlugin) pluginsOpt; + inherit (typesPlugin) pluginsOpt extraPluginType; inherit (typesLanguage) diagnostics mkGrammarOption; } diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index 111fd8c..6ee0d46 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -97,7 +97,26 @@ with lib; let package ) ); + + extraPluginType = with types; + submodule { + options = { + package = mkOption { + type = pluginsType; + }; + dependencies = mkOption { + type = listOf str; + default = []; + }; + setup = mkOption { + type = lines; + default = ""; + }; + }; + }; in { + inherit extraPluginType; + pluginsOpt = { description, default ? [], diff --git a/modules/core/default.nix b/modules/core/default.nix index 9261caf..48769ec 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -158,6 +158,11 @@ in { description = "List of plugins to optionally load"; }; + extraPlugins = mkOption { + type = types.attrsOf nvim.types.extraPluginType; + default = {}; + }; + globals = mkOption { default = {}; description = "Set containing global variable values";