From 7472cac221bbd7777c7ad832d5883013e6279ae0 Mon Sep 17 00:00:00 2001 From: LilleAila Date: Fri, 17 Jan 2025 20:19:02 +0100 Subject: [PATCH] mini/files: init --- docs/release-notes/rl-0.8.md | 1 + flake.lock | 17 +++++++++++++++++ flake.nix | 5 +++++ modules/plugins/mini/default.nix | 1 + modules/plugins/mini/files/config.nix | 19 +++++++++++++++++++ modules/plugins/mini/files/default.nix | 6 ++++++ modules/plugins/mini/files/files.nix | 13 +++++++++++++ 7 files changed, 62 insertions(+) create mode 100644 modules/plugins/mini/files/config.nix create mode 100644 modules/plugins/mini/files/default.nix create mode 100644 modules/plugins/mini/files/files.nix diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 0e87c9c5..1d76bfa2 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -68,6 +68,7 @@ - `mini.diff` - `mini.doc` - `mini.extra` + - `mini.files` [kaktu5](https://github.com/kaktu5): diff --git a/flake.lock b/flake.lock index 7442f67e..c8652ec2 100644 --- a/flake.lock +++ b/flake.lock @@ -1160,6 +1160,22 @@ "type": "github" } }, + "plugin-mini-files": { + "flake": false, + "locked": { + "lastModified": 1736535707, + "narHash": "sha256-UHW78m4BiYMMrABwdkyyzQUENgQrVFbWJnmNdRMtr0w=", + "owner": "echasnovski", + "repo": "mini.files", + "rev": "d0f03a5c38836fd2cce3dc80734124959002078c", + "type": "github" + }, + "original": { + "owner": "echasnovski", + "repo": "mini.files", + "type": "github" + } + }, "plugin-minimap-vim": { "flake": false, "locked": { @@ -2370,6 +2386,7 @@ "plugin-mini-diff": "plugin-mini-diff", "plugin-mini-doc": "plugin-mini-doc", "plugin-mini-extra": "plugin-mini-extra", + "plugin-mini-files": "plugin-mini-files", "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 ca26f859..ea1d9e90 100644 --- a/flake.nix +++ b/flake.nix @@ -815,5 +815,10 @@ url = "github:echasnovski/mini.extra"; flake = false; }; + + plugin-mini-files = { + url = "github:echasnovski/mini.files"; + flake = false; + }; }; } diff --git a/modules/plugins/mini/default.nix b/modules/plugins/mini/default.nix index d945a222..515b5cb4 100644 --- a/modules/plugins/mini/default.nix +++ b/modules/plugins/mini/default.nix @@ -14,5 +14,6 @@ ./diff ./doc ./extra + ./files ]; } diff --git a/modules/plugins/mini/files/config.nix b/modules/plugins/mini/files/config.nix new file mode 100644 index 00000000..eb195f8d --- /dev/null +++ b/modules/plugins/mini/files/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.files; +in { + vim = mkIf cfg.enable { + startPlugins = ["mini-files"]; + + pluginRC.mini-files = entryAnywhere '' + require("mini.files").setup(${toLuaObject cfg.setupOpts}) + ''; + }; +} diff --git a/modules/plugins/mini/files/default.nix b/modules/plugins/mini/files/default.nix new file mode 100644 index 00000000..6c0ebbc0 --- /dev/null +++ b/modules/plugins/mini/files/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./files.nix + ./config.nix + ]; +} diff --git a/modules/plugins/mini/files/files.nix b/modules/plugins/mini/files/files.nix new file mode 100644 index 00000000..f9c3f8ca --- /dev/null +++ b/modules/plugins/mini/files/files.nix @@ -0,0 +1,13 @@ +{ + config, + lib, + ... +}: let + inherit (lib.options) mkEnableOption mkOption; + inherit (lib.nvim.types) mkPluginSetupOption; +in { + options.vim.mini.files = { + enable = mkEnableOption "mini.files"; + setupOpts = mkPluginSetupOption "mini.files" {}; + }; +}