Skip to content

Commit

Permalink
mini/starter: prefer or snacks dashboard again
Browse files Browse the repository at this point in the history
Dashboard has horrible customization atm.
  • Loading branch information
khaneliman committed Feb 3, 2025
1 parent 60eba74 commit c51aac3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 43 deletions.
73 changes: 31 additions & 42 deletions modules/nixvim/plugins/mini/starter.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,51 +7,40 @@
modules = {
# TODO: compare against persistence
# sessions = { };
starter =
lib.mkIf
(
!config.plugins.snacks.enable
|| (config.plugins.snacks.enable && !lib.hasAttr "dashboard" config.plugins.snacks.settings)
|| (
config.plugins.snacks.enable
&& lib.hasAttr "dashboard" config.plugins.snacks.settings.dashboard
&& !config.plugins.snacs.settings.dashboard.enabled
)
)
{
header = ''
██╗ ██╗██╗ ██╗ █████╗ ███╗ ██╗███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗
██║ ██╔╝██║ ██║██╔══██╗████╗ ██║██╔════╝██║ ██║██║ ██║██║████╗ ████║
█████╔╝ ███████║███████║██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║
██╔═██╗ ██╔══██║██╔══██║██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║
██║ ██╗██║ ██║██║ ██║██║ ╚████║███████╗███████╗██║ ╚████╔╝ ██║██║ ╚═╝ ██║
╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚══════╝╚══════╝╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
'';
starter = {
header = ''
██╗ ██╗██╗ ██╗ █████╗ ███╗ ██╗███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗
██║ ██╔╝██║ ██║██╔══██╗████╗ ██║██╔════╝██║ ██║██║ ██║██║████╗ ████║
█████╔╝ ███████║███████║██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║
██╔═██╗ ██╔══██║██╔══██║██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║
██║ ██╗██║ ██║██║ ██║██║ ╚████║███████╗███████╗██║ ╚████╔╝ ██║██║ ╚═╝ ██║
╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚══════╝╚══════╝╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
'';

evaluate_single = true;
evaluate_single = true;

items = {
"__unkeyed-1.builtin_actions".__raw = "require('mini.starter').sections.builtin_actions()";
"__unkeyed-2.recent_files_current_directory".__raw =
"require('mini.starter').sections.recent_files(10, true)";
"__unkeyed-3.recent_files".__raw = "require('mini.starter').sections.recent_files(10, false)";
"__unkeyed-4.sessions".__raw = lib.mkIf (
config.plugins.mini.enable && lib.hasAttr "sessions" config.plugins.mini.modules
) "require('mini.starter').sections.sessions(5, true)";
__unkeyed-5 = lib.mkIf config.plugins.persistence.enable {
name = "Restore session";
action.__raw = "[[lua require('persistence').load()]]";
section = "Session";
};
};

content_hooks = {
"__unkeyed-1.adding_bullet".__raw = "require('mini.starter').gen_hook.adding_bullet()";
"__unkeyed-2.indexing".__raw =
"require('mini.starter').gen_hook.indexing('all', { 'Builtin actions' })";
"__unkeyed-3.padding".__raw = "require('mini.starter').gen_hook.aligning('center', 'center')";
};
items = {
"__unkeyed-1.builtin_actions".__raw = "require('mini.starter').sections.builtin_actions()";
"__unkeyed-2.recent_files_current_directory".__raw =
"require('mini.starter').sections.recent_files(10, true)";
"__unkeyed-3.recent_files".__raw = "require('mini.starter').sections.recent_files(10, false)";
"__unkeyed-4.sessions".__raw = lib.mkIf (
config.plugins.mini.enable && lib.hasAttr "sessions" config.plugins.mini.modules
) "require('mini.starter').sections.sessions(5, true)";
__unkeyed-5 = lib.mkIf config.plugins.persistence.enable {
name = "Restore session";
action.__raw = "[[lua require('persistence').load()]]";
section = "Session";
};
};

content_hooks = {
"__unkeyed-1.adding_bullet".__raw = "require('mini.starter').gen_hook.adding_bullet()";
"__unkeyed-2.indexing".__raw =
"require('mini.starter').gen_hook.indexing('all', { 'Builtin actions' })";
"__unkeyed-3.padding".__raw = "require('mini.starter').gen_hook.aligning('center', 'center')";
};
};
};
};
};
Expand Down
3 changes: 2 additions & 1 deletion modules/nixvim/plugins/snacks/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
imports = [
./bigfile.nix
./bufdelete.nix
./dashboard.nix
# FIXME: inf recursion trying to logic gate
# ./dashboard.nix
./gitbrowse.nix
./lazygit.nix
./picker.nix
Expand Down

0 comments on commit c51aac3

Please sign in to comment.