From 11a68d154ca1aed8311a925081f993899b60b889 Mon Sep 17 00:00:00 2001 From: imMaturana Date: Mon, 11 Jul 2022 15:51:18 -0400 Subject: [PATCH] dashboard.nvim: remove setup method --- plugins/utils/dashboard.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/utils/dashboard.nix b/plugins/utils/dashboard.nix index 626e70c2..77b2e84e 100644 --- a/plugins/utils/dashboard.nix +++ b/plugins/utils/dashboard.nix @@ -107,7 +107,7 @@ in config = let - setupOptions = { + options = { custom_header = cfg.header; custom_footer = cfg.footer; custom_center = cfg.center; @@ -122,10 +122,18 @@ in session_directory = cfg.sessionDirectory; }; + + filteredOptions = filterAttrs (_: v: !isNull v) options; in mkIf cfg.enable { programs.nixvim = { extraPlugins = [ pkgs.vimPlugins.dashboard-nvim ]; - extraConfigLua = ''require("dashboard").setup(${helpers.toLuaObject setupOptions})''; + extraConfigLua = '' + local dashboard = require("dashboard") + + ${toString (mapAttrsToList (n: v: + "dashboard.${n} = ${helpers.toLuaObject v}\n") + filteredOptions)} + ''; }; }; }