From 3d91f6c4c110a16c4fd70208b252401eb152879d Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Thu, 16 Feb 2023 23:57:56 +0300 Subject: [PATCH] feat: add mind-nvim to note-taking plugins --- extra.nix | 3 ++- flake.lock | 17 ++++++++++++++++ flake.nix | 5 +++++ lib/types-plugin.nix | 1 + modules/notes/default.nix | 1 + modules/notes/mind-nvim/default.nix | 30 +++++++++++++++++++++++++++++ 6 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 modules/notes/mind-nvim/default.nix diff --git a/extra.nix b/extra.nix index bbb2943..b5231fb 100644 --- a/extra.nix +++ b/extra.nix @@ -136,7 +136,8 @@ inputs: let vim.notes = { obsidian.enable = false; # FIXME neovim fails to build if obsidian is enabled - orgmode.enable = true; + orgmode.enable = false; + mind-nvim.enable = true; }; vim.terminal = { diff --git a/flake.lock b/flake.lock index 506588a..b53a8f5 100644 --- a/flake.lock +++ b/flake.lock @@ -514,6 +514,22 @@ "type": "github" } }, + "mind-nvim": { + "flake": false, + "locked": { + "lastModified": 1674572816, + "narHash": "sha256-yLf/2NvPT0RtFh6+0W32Uaj3Tjs52oyZSb8Jq3INZI4=", + "owner": "phaazon", + "repo": "mind.nvim", + "rev": "e59c52758c399caceb549c698cfa2d65e6bbb9f9", + "type": "github" + }, + "original": { + "owner": "phaazon", + "repo": "mind.nvim", + "type": "github" + } + }, "minimap-vim": { "flake": false, "locked": { @@ -1079,6 +1095,7 @@ "lspkind": "lspkind", "lspsaga": "lspsaga", "lualine": "lualine", + "mind-nvim": "mind-nvim", "minimap-vim": "minimap-vim", "nil": "nil", "nixpkgs": "nixpkgs", diff --git a/flake.nix b/flake.nix index 2d0ace8..4cd1704 100644 --- a/flake.nix +++ b/flake.nix @@ -361,6 +361,11 @@ flake = false; }; + mind-nvim = { + url = "github:phaazon/mind.nvim"; + flake = false; + }; + # Terminal toggleterm-nvim = { url = "github:akinsho/toggleterm.nvim"; diff --git a/lib/types-plugin.nix b/lib/types-plugin.nix index 8b3506d..646f4eb 100644 --- a/lib/types-plugin.nix +++ b/lib/types-plugin.nix @@ -68,6 +68,7 @@ with lib; let "gesture-nvim" "comment-nvim" "kommentary" + "mind-nvim" ]; # You can either use the name of the plugin or a package. pluginsType = with types; listOf (nullOr (either (enum availablePlugins) package)); diff --git a/modules/notes/default.nix b/modules/notes/default.nix index 7361a35..b8c2059 100644 --- a/modules/notes/default.nix +++ b/modules/notes/default.nix @@ -2,5 +2,6 @@ _: { imports = [ ./obsidian ./orgmode + ./mind-nvim ]; } diff --git a/modules/notes/mind-nvim/default.nix b/modules/notes/mind-nvim/default.nix new file mode 100644 index 0000000..60cdfef --- /dev/null +++ b/modules/notes/mind-nvim/default.nix @@ -0,0 +1,30 @@ +{ + pkgs, + config, + lib, + ... +}: +with lib; +with builtins; let + cfg = config.vim.notes.mind-nvim; +in { + options.vim.notes.mind-nvim = { + enable = mkEnableOption "The power of trees at your fingertips. "; + }; + + config = mkIf (cfg.enable) { + vim.startPlugins = [ + "mind-nvim" + ]; + + vim.nnoremap = { + "" = ":MindOpenMain"; + ""; + "mc" = ":MindClose"; + }; + + vim.luaConfigRC.mind-nvim = nvim.dag.entryAnywhere '' + require'mind'.setup() + ''; + }; +}