From 8923d3b891b4f6ad0dfeb14aa8c049987cdecdbc Mon Sep 17 00:00:00 2001 From: LilleAila Date: Fri, 17 Jan 2025 18:57:59 +0100 Subject: [PATCH] mini/ai: init --- docs/release-notes/rl-0.8.md | 2 ++ flake.lock | 17 +++++++++++++++++ flake.nix | 6 ++++++ modules/modules.nix | 1 + modules/plugins/mini/ai/ai.nix | 13 +++++++++++++ modules/plugins/mini/ai/config.nix | 19 +++++++++++++++++++ modules/plugins/mini/ai/default.nix | 6 ++++++ modules/plugins/mini/default.nix | 5 +++++ 8 files changed, 69 insertions(+) create mode 100644 modules/plugins/mini/ai/ai.nix create mode 100644 modules/plugins/mini/ai/config.nix create mode 100644 modules/plugins/mini/ai/default.nix create mode 100644 modules/plugins/mini/default.nix diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index d15c6842..067782d8 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -53,6 +53,8 @@ issue with setting the workspace directory. - Add `vim.snippets.luasnip.setupOpts`, which was previously missing. - Add `"prettierd"` as a formatter option in `vim.languages.markdown.format.type`. +- Add the following plugins from [mini.nvim](https://github.com/echasnovski/mini.nvim) + - `mini.ai` [kaktu5](https://github.com/kaktu5): diff --git a/flake.lock b/flake.lock index da38b967..351eae83 100644 --- a/flake.lock +++ b/flake.lock @@ -936,6 +936,22 @@ "type": "github" } }, + "plugin-mini-ai": { + "flake": false, + "locked": { + "lastModified": 1733662803, + "narHash": "sha256-b/776l9nYM9e2atzXrvOk9dCxjzIuW/+iINC/yPv88Y=", + "owner": "echasnovski", + "repo": "mini.ai", + "rev": "ebb04799794a7f94628153991e6334c3304961b8", + "type": "github" + }, + "original": { + "owner": "echasnovski", + "repo": "mini.ai", + "type": "github" + } + }, "plugin-minimap-vim": { "flake": false, "locked": { @@ -2132,6 +2148,7 @@ "plugin-lz-n": "plugin-lz-n", "plugin-lzn-auto-require": "plugin-lzn-auto-require", "plugin-mind-nvim": "plugin-mind-nvim", + "plugin-mini-ai": "plugin-mini-ai", "plugin-minimap-vim": "plugin-minimap-vim", "plugin-modes-nvim": "plugin-modes-nvim", "plugin-neo-tree-nvim": "plugin-neo-tree-nvim", diff --git a/flake.nix b/flake.nix index 89690cad..c236e71a 100644 --- a/flake.nix +++ b/flake.nix @@ -744,5 +744,11 @@ url = "github:stevearc/aerial.nvim"; flake = false; }; + + # Mini.nvim + plugin-mini-ai = { + url = "github:echasnovski/mini.ai"; + flake = false; + }; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 6e05c592..65b0c966 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -27,6 +27,7 @@ "git" "languages" "lsp" + "mini" "minimap" "notes" "projects" diff --git a/modules/plugins/mini/ai/ai.nix b/modules/plugins/mini/ai/ai.nix new file mode 100644 index 00000000..c8e60b8e --- /dev/null +++ b/modules/plugins/mini/ai/ai.nix @@ -0,0 +1,13 @@ +{ + config, + lib, + ... +}: let + inherit (lib.options) mkEnableOption mkOption; + inherit (lib.nvim.types) mkPluginSetupOption; +in { + options.vim.mini.ai = { + enable = mkEnableOption "mini.ai"; + setupOpts = mkPluginSetupOption "mini.ai" {}; + }; +} diff --git a/modules/plugins/mini/ai/config.nix b/modules/plugins/mini/ai/config.nix new file mode 100644 index 00000000..7385e1b1 --- /dev/null +++ b/modules/plugins/mini/ai/config.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + ... +}: let + inherit (lib.modules) mkIf; + inherit (lib.nvim.dag) entryAnywhere; + inherit (lib.nvim.lua) toLuaObject; + + cfg = config.vim.mini.ai; +in { + vim = mkIf cfg.enable { + startPlugins = ["mini-ai"]; + + pluginRC.mini-ai = entryAnywhere '' + require("mini.ai").setup(${toLuaObject cfg.setupOpts}) + ''; + }; +} diff --git a/modules/plugins/mini/ai/default.nix b/modules/plugins/mini/ai/default.nix new file mode 100644 index 00000000..57da6c08 --- /dev/null +++ b/modules/plugins/mini/ai/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./ai.nix + ./config.nix + ]; +} diff --git a/modules/plugins/mini/default.nix b/modules/plugins/mini/default.nix new file mode 100644 index 00000000..f3632321 --- /dev/null +++ b/modules/plugins/mini/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./ai + ]; +}