mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-01-19 16:32:24 +00:00
collections/mini: init
This commit is contained in:
parent
4b9047025f
commit
952a3f1ad0
7 changed files with 95 additions and 0 deletions
17
flake.lock
17
flake.lock
|
@ -936,6 +936,22 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"plugin-mini-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1736875588,
|
||||
"narHash": "sha256-v5cMB/IK+muogipWPtU7rFTfYWO7wr+VyGfqPU/fE70=",
|
||||
"owner": "echasnovski",
|
||||
"repo": "mini.nvim",
|
||||
"rev": "9e603a31d3fbc7ee61c9b556cd84e97fa2dcff53",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "echasnovski",
|
||||
"repo": "mini.nvim",
|
||||
"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-nvim": "plugin-mini-nvim",
|
||||
"plugin-minimap-vim": "plugin-minimap-vim",
|
||||
"plugin-modes-nvim": "plugin-modes-nvim",
|
||||
"plugin-neo-tree-nvim": "plugin-neo-tree-nvim",
|
||||
|
|
|
@ -744,5 +744,11 @@
|
|||
url = "github:stevearc/aerial.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Plugin collections
|
||||
plugin-mini-nvim = {
|
||||
url = "github:echasnovski/mini.nvim";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
plugins = map (p: ./plugins + "/${p}") [
|
||||
"assistant"
|
||||
"autopairs"
|
||||
"collections"
|
||||
"comments"
|
||||
"completion"
|
||||
"dashboard"
|
||||
|
|
5
modules/plugins/collections/default.nix
Normal file
5
modules/plugins/collections/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
imports = [
|
||||
./mini-nvim
|
||||
];
|
||||
}
|
32
modules/plugins/collections/mini-nvim/config.nix
Normal file
32
modules/plugins/collections/mini-nvim/config.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
options,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkMerge;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.strings) concatStringsSep;
|
||||
inherit (lib.attrsets) mapAttrsToList;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
||||
cfg = config.vim.collections.mini-nvim;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim.lazy.plugins."mini-nvim" = {
|
||||
package = "mini-nvim";
|
||||
# package = pkgs.vimPlugins.mini-nvim;
|
||||
# package = pkgs.vimUtils.buildVimPlugin {
|
||||
# name = "mini-nvim";
|
||||
# src = inputs.plugin-mini-nvim;
|
||||
# };
|
||||
lazy = false;
|
||||
after = concatStringsSep "\n" (mapAttrsToList (name: value: ''
|
||||
require("mini.${name}").setup(${toLuaObject value.setupOpts})
|
||||
'')
|
||||
cfg.modules);
|
||||
};
|
||||
};
|
||||
}
|
6
modules/plugins/collections/mini-nvim/default.nix
Normal file
6
modules/plugins/collections/mini-nvim/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./mini-nvim.nix
|
||||
];
|
||||
}
|
28
modules/plugins/collections/mini-nvim/mini-nvim.nix
Normal file
28
modules/plugins/collections/mini-nvim/mini-nvim.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
||||
inherit (lib.types) attrsOf submodule;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
in {
|
||||
options.vim.collections.mini-nvim = {
|
||||
enable = mkEnableOption "mini.nvim, a collection of quality-of-life modules";
|
||||
modules = mkOption {
|
||||
type = attrsOf (submodule {
|
||||
options = {
|
||||
setupOpts = mkPluginSetupOption "mini.nvim plugin" {};
|
||||
};
|
||||
});
|
||||
default = {};
|
||||
example =
|
||||
literalExpression
|
||||
''
|
||||
{
|
||||
files = {};
|
||||
sessions = {
|
||||
autoread = true;
|
||||
autowrite = true;
|
||||
};
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue