mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-12 06:19:00 +00:00
nixvim/plugins/legendary-nvim: init
This commit is contained in:
parent
9a636daee1
commit
b0b7fb5cc9
@ -3,6 +3,7 @@
|
|||||||
./keyunmaps.nix
|
./keyunmaps.nix
|
||||||
./plugins/firenvim.nix
|
./plugins/firenvim.nix
|
||||||
./plugins/lush-nvim.nix
|
./plugins/lush-nvim.nix
|
||||||
|
./plugins/legendary-nvim.nix
|
||||||
./plugins/nvim-config-local.nix
|
./plugins/nvim-config-local.nix
|
||||||
./plugins/smart-splits.nix
|
./plugins/smart-splits.nix
|
||||||
./tinted-theming.nix
|
./tinted-theming.nix
|
||||||
|
68
modules/nixvim/plugins/legendary-nvim.nix
Normal file
68
modules/nixvim/plugins/legendary-nvim.nix
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
{ config, lib, helpers, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.plugins.legendary-nvim;
|
||||||
|
|
||||||
|
mkEnableOption' = desc: lib.mkEnableOption desc // { default = true; };
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.plugins.legendary-nvim = {
|
||||||
|
enable = lib.mkEnableOption "legendary.nvim";
|
||||||
|
|
||||||
|
package = helpers.mkPackageOption "legendary.nvim" pkgs.vimPlugins.legendary-nvim;
|
||||||
|
|
||||||
|
additionalSetup = mkEnableOption' "dependencies for additional features like frecency sorting";
|
||||||
|
|
||||||
|
integrations = {
|
||||||
|
nvim-tree.enable =
|
||||||
|
mkEnableOption' "integration with nvim-tree (if installed)";
|
||||||
|
smart-splits.enable =
|
||||||
|
mkEnableOption' "integration with smart-splits.nvim (if installed)";
|
||||||
|
diffview.enable =
|
||||||
|
mkEnableOption' "integration with diffview (if installed)";
|
||||||
|
};
|
||||||
|
|
||||||
|
settings = lib.mkOption {
|
||||||
|
type = lib.types.submodule {
|
||||||
|
freefromType = with lib.types; attrsOf anything;
|
||||||
|
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf
|
||||||
|
(
|
||||||
|
config.plugins.nvim-tree.enable && cfg.integrations.nvim-tree.enable
|
||||||
|
)
|
||||||
|
{ extensions.nvim_tree = true; })
|
||||||
|
(lib.mkIf
|
||||||
|
(
|
||||||
|
config.plugins.smart-splits.enable && cfg.integrations.smart-splits.enable
|
||||||
|
)
|
||||||
|
{
|
||||||
|
extensions.smart_splits = {
|
||||||
|
directions = [ "h" "j" "k" "l" ];
|
||||||
|
mods = { };
|
||||||
|
};
|
||||||
|
})
|
||||||
|
(lib.mkIf
|
||||||
|
(
|
||||||
|
config.plugins.diffview.enable && cfg.integrations.diffview.enable
|
||||||
|
)
|
||||||
|
{ extensions.diffview = true; })
|
||||||
|
];
|
||||||
|
};
|
||||||
|
default = { };
|
||||||
|
example = { };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
extraPlugins =
|
||||||
|
[ cfg.package ]
|
||||||
|
++ lib.optional cfg.additionalSetup pkgs.vimPlugins.sqlite-lua;
|
||||||
|
|
||||||
|
extraPackages = lib.optional cfg.additionalSetup pkgs.sqlite;
|
||||||
|
|
||||||
|
extraConfigLua = ''
|
||||||
|
require('legendary').setup(${helpers.toLuaObject cfg.settings})
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user