From c4905362303a735a951d6afc9c6d6b5e75f9096c Mon Sep 17 00:00:00 2001 From: LilleAila Date: Fri, 17 Jan 2025 20:23:40 +0100 Subject: [PATCH] mini/git: init --- docs/release-notes/rl-0.8.md | 1 + flake.lock | 17 +++++++++++++++++ flake.nix | 5 +++++ modules/plugins/mini/default.nix | 1 + modules/plugins/mini/git/config.nix | 19 +++++++++++++++++++ modules/plugins/mini/git/default.nix | 6 ++++++ modules/plugins/mini/git/git.nix | 13 +++++++++++++ 7 files changed, 62 insertions(+) create mode 100644 modules/plugins/mini/git/config.nix create mode 100644 modules/plugins/mini/git/default.nix create mode 100644 modules/plugins/mini/git/git.nix diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 5c0fb555..a2bc984e 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -70,6 +70,7 @@ - `mini.extra` - `mini.files` - `mini.fuzzy` + - `mini.git` [kaktu5](https://github.com/kaktu5): diff --git a/flake.lock b/flake.lock index 7ac9b0e5..5feff935 100644 --- a/flake.lock +++ b/flake.lock @@ -1192,6 +1192,22 @@ "type": "github" } }, + "plugin-mini-git": { + "flake": false, + "locked": { + "lastModified": 1736535710, + "narHash": "sha256-rXuKopyZBCBbpKuytCdm8keruSNK1ohk2NdeZv1wifI=", + "owner": "echasnovski", + "repo": "mini-git", + "rev": "fc13dde6cfe87cf25a4fd1ee177c0d157468436b", + "type": "github" + }, + "original": { + "owner": "echasnovski", + "repo": "mini-git", + "type": "github" + } + }, "plugin-minimap-vim": { "flake": false, "locked": { @@ -2404,6 +2420,7 @@ "plugin-mini-extra": "plugin-mini-extra", "plugin-mini-files": "plugin-mini-files", "plugin-mini-fuzzy": "plugin-mini-fuzzy", + "plugin-mini-git": "plugin-mini-git", "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 73eef497..519fc5dd 100644 --- a/flake.nix +++ b/flake.nix @@ -825,5 +825,10 @@ url = "github:echasnovski/mini.fuzzy"; flake = false; }; + + plugin-mini-git = { + url = "github:echasnovski/mini-git"; + flake = false; + }; }; } diff --git a/modules/plugins/mini/default.nix b/modules/plugins/mini/default.nix index 69dd8ce6..df37de8e 100644 --- a/modules/plugins/mini/default.nix +++ b/modules/plugins/mini/default.nix @@ -16,5 +16,6 @@ ./extra ./files ./fuzzy + ./git ]; } diff --git a/modules/plugins/mini/git/config.nix b/modules/plugins/mini/git/config.nix new file mode 100644 index 00000000..41a3d6cb --- /dev/null +++ b/modules/plugins/mini/git/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.git; +in { + vim = mkIf cfg.enable { + startPlugins = ["mini-git"]; + + pluginRC.mini-git = entryAnywhere '' + require("mini.git").setup(${toLuaObject cfg.setupOpts}) + ''; + }; +} diff --git a/modules/plugins/mini/git/default.nix b/modules/plugins/mini/git/default.nix new file mode 100644 index 00000000..e7622aa0 --- /dev/null +++ b/modules/plugins/mini/git/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./git.nix + ./config.nix + ]; +} diff --git a/modules/plugins/mini/git/git.nix b/modules/plugins/mini/git/git.nix new file mode 100644 index 00000000..f77a7502 --- /dev/null +++ b/modules/plugins/mini/git/git.nix @@ -0,0 +1,13 @@ +{ + config, + lib, + ... +}: let + inherit (lib.options) mkEnableOption mkOption; + inherit (lib.nvim.types) mkPluginSetupOption; +in { + options.vim.mini.git = { + enable = mkEnableOption "mini.git"; + setupOpts = mkPluginSetupOption "mini.git" {}; + }; +}