collections/mini: init

This commit is contained in:
LilleAila 2025-01-16 08:23:19 +01:00
parent 4b9047025f
commit 952a3f1ad0
No known key found for this signature in database
GPG key ID: D1ACCDCF2B9B9799
7 changed files with 95 additions and 0 deletions

View file

@ -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",

View file

@ -744,5 +744,11 @@
url = "github:stevearc/aerial.nvim";
flake = false;
};
# Plugin collections
plugin-mini-nvim = {
url = "github:echasnovski/mini.nvim";
flake = false;
};
};
}

View file

@ -19,6 +19,7 @@
plugins = map (p: ./plugins + "/${p}") [
"assistant"
"autopairs"
"collections"
"comments"
"completion"
"dashboard"

View file

@ -0,0 +1,5 @@
{
imports = [
./mini-nvim
];
}

View 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);
};
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./config.nix
./mini-nvim.nix
];
}

View 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;
};
}
'';
};
};
}