From ccea1a615938859401f35e4a21dfd2b480d7c5f7 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sat, 28 Sep 2024 22:18:28 +0300 Subject: [PATCH] dashboard/dashboard-nvim: add setupOpts --- modules/plugins/dashboard/dashboard-nvim/config.nix | 13 +++++++------ .../dashboard/dashboard-nvim/dashboard-nvim.nix | 2 ++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/plugins/dashboard/dashboard-nvim/config.nix b/modules/plugins/dashboard/dashboard-nvim/config.nix index 088842a..7ded14c 100644 --- a/modules/plugins/dashboard/dashboard-nvim/config.nix +++ b/modules/plugins/dashboard/dashboard-nvim/config.nix @@ -5,16 +5,17 @@ }: let inherit (lib.modules) mkIf; inherit (lib.nvim.dag) entryAnywhere; + inherit (lib.nvim.lua) toLuaObject; cfg = config.vim.dashboard.dashboard-nvim; in { config = mkIf cfg.enable { - vim.startPlugins = [ - "dashboard-nvim" - ]; + vim = { + startPlugins = ["dashboard-nvim"]; - vim.pluginRC.dashboard-nvim = entryAnywhere '' - require("dashboard").setup{} - ''; + pluginRC.dashboard-nvim = entryAnywhere '' + require("dashboard").setup(${toLuaObject cfg.setupOpts}) + ''; + }; }; } diff --git a/modules/plugins/dashboard/dashboard-nvim/dashboard-nvim.nix b/modules/plugins/dashboard/dashboard-nvim/dashboard-nvim.nix index 518082e..cdc41fc 100644 --- a/modules/plugins/dashboard/dashboard-nvim/dashboard-nvim.nix +++ b/modules/plugins/dashboard/dashboard-nvim/dashboard-nvim.nix @@ -1,7 +1,9 @@ {lib, ...}: let inherit (lib.options) mkEnableOption; + inherit (lib.nvim.types) mkPluginSetupOption; in { options.vim.dashboard.dashboard-nvim = { enable = mkEnableOption "Fancy and Blazing Fast start screen plugin of neovim [dashboard.nvim]"; + setupOpts = mkPluginSetupOption "dashboard.nvim" {}; }; }