From 90b8a45092f6f2f4ea2f5d586364feb7defa1158 Mon Sep 17 00:00:00 2001 From: Alexander Nortung Date: Thu, 1 Dec 2022 20:57:06 +0100 Subject: [PATCH] Added extra options (#62) * Added extraOptions helper * project-nvim: added extraOptions --- plugins/helpers.nix | 11 +++++++++++ plugins/utils/project-nvim.nix | 5 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/plugins/helpers.nix b/plugins/helpers.nix index 32eba33c..ab6a9866 100644 --- a/plugins/helpers.nix +++ b/plugins/helpers.nix @@ -106,6 +106,17 @@ rec { inherit value global; }; + extraOptionsOptions = { + extraOptions = mkOption { + default = { }; + type = types.attrs; + description = '' + These attributes will be added to the table parameter for the setup function. + (Can override other attributes set by nixvim) + ''; + }; + }; + mkRaw = r: { __raw = r; }; wrapDo = string: '' diff --git a/plugins/utils/project-nvim.nix b/plugins/utils/project-nvim.nix index ff76926f..d81b7251 100644 --- a/plugins/utils/project-nvim.nix +++ b/plugins/utils/project-nvim.nix @@ -5,7 +5,7 @@ let helpers = import ../helpers.nix { inherit lib; }; in { - options.plugins.project-nvim = { + options.plugins.project-nvim = helpers.extraOptionsOptions // { enable = mkEnableOption "Enable project.nvim"; manualMode = mkOption { @@ -52,6 +52,7 @@ in type = types.nullOr (types.either types.str helpers.rawType); default = null; }; + }; config = @@ -66,7 +67,7 @@ in silent_chdir = cfg.silentChdir; scope_schdir = cfg.scopeChdir; data_path = cfg.dataPath; - }; + } // cfg.extraOptions; in mkIf cfg.enable { extraPlugins = [ pkgs.vimPlugins.project-nvim ];