1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-12-08 18:11:07 +01:00

treewide: remove with lib;

This commit is contained in:
Gaetan Lepage 2025-12-07 12:28:40 +01:00 committed by Gaétan Lepage
parent cd0443e166
commit 629f9d75f8
67 changed files with 276 additions and 338 deletions

View file

@ -1,11 +1,10 @@
{ lib, ... }: { lib, ... }:
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "arrow"; name = "arrow";
package = "arrow-nvim"; package = "arrow-nvim";
description = "A Neovim plugin to bookmark and navigate through files."; description = "A Neovim plugin to bookmark and navigate through files.";
maintainers = [ maintainers.hmajid2301 ]; maintainers = [ lib.maintainers.hmajid2301 ];
settingsOptions = { settingsOptions = {
show_icons = lib.nixvim.defaultNullOpts.mkBool false '' show_icons = lib.nixvim.defaultNullOpts.mkBool false ''
@ -93,7 +92,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
}; };
window = window =
lib.nixvim.defaultNullOpts.mkAttrsOf types.anything lib.nixvim.defaultNullOpts.mkAttrsOf lib.types.anything
{ {
relative = "editor"; relative = "editor";
width = "auto"; width = "auto";
@ -153,7 +152,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
Keys mapped to bookmark index. Keys mapped to bookmark index.
''; '';
full_path_list = lib.nixvim.defaultNullOpts.mkListOf types.str [ "update_stuff" ] '' full_path_list = lib.nixvim.defaultNullOpts.mkListOf lib.types.str [ "update_stuff" ] ''
Filenames on this list will ALWAYS show the file path too Filenames on this list will ALWAYS show the file path too
''; '';
}; };

View file

@ -1,6 +1,6 @@
{ config, lib, ... }: { config, lib, ... }:
with lib;
let let
inherit (lib) mkOption types;
inherit (lib.nixvim) inherit (lib.nixvim)
defaultNullOpts defaultNullOpts
keymaps keymaps
@ -66,12 +66,12 @@ lib.nixvim.plugins.mkNeovimPlugin {
package = "barbar-nvim"; package = "barbar-nvim";
description = "A neovim tabline plugin."; description = "A neovim tabline plugin.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
extraOptions = { extraOptions = {
keymaps = mapAttrs ( keymaps = lib.mapAttrs (
optionName: funcName: optionName: funcName:
lib.mkOption { mkOption {
type = v2NullOr ( type = v2NullOr (
keymaps.mkMapOptionSubmodule { keymaps.mkMapOptionSubmodule {
defaults = { defaults = {
@ -90,7 +90,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
extraConfig = cfg: { extraConfig = cfg: {
# TODO: added 2024-09-20 remove after 24.11 # TODO: added 2024-09-20 remove after 24.11
plugins.web-devicons = mkIf ( plugins.web-devicons = lib.mkIf (
!( !(
( (
config.plugins.mini.enable config.plugins.mini.enable
@ -99,11 +99,11 @@ lib.nixvim.plugins.mkNeovimPlugin {
) )
|| (config.plugins.mini-icons.enable && config.plugins.mini-icons.mockDevIcons) || (config.plugins.mini-icons.enable && config.plugins.mini-icons.mockDevIcons)
) )
) { enable = mkOverride 1490 true; }; ) { enable = lib.mkOverride 1490 true; };
keymaps = filter (keymap: keymap != null) ( keymaps = lib.filter (keymap: keymap != null) (
# TODO: switch to `attrValues cfg.keymaps` when removing the deprecation warnings above: # TODO: switch to `attrValues cfg.keymaps` when removing the deprecation warnings above:
attrValues (filterAttrs (n: v: n != "silent") cfg.keymaps) lib.attrValues (lib.filterAttrs (n: v: n != "silent") cfg.keymaps)
); );
}; };

View file

@ -1,15 +1,14 @@
{ { lib, ... }:
lib, let
... inherit (lib) types;
}: in
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "better-escape"; name = "better-escape";
moduleName = "better_escape"; moduleName = "better_escape";
package = "better-escape-nvim"; package = "better-escape-nvim";
description = "A Neovim plugin to quickly exit insert mode without losing your typed text."; description = "A Neovim plugin to quickly exit insert mode without losing your typed text.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = { settingsOptions = {
timeout = lib.nixvim.defaultNullOpts.mkStrLuaOr types.ints.unsigned "vim.o.timeoutlen" '' timeout = lib.nixvim.defaultNullOpts.mkStrLuaOr types.ints.unsigned "vim.o.timeoutlen" ''

View file

@ -1,14 +1,10 @@
{ { lib, ... }:
lib,
...
}:
with lib;
lib.nixvim.plugins.mkVimPlugin { lib.nixvim.plugins.mkVimPlugin {
name = "bufdelete"; name = "bufdelete";
package = "bufdelete-nvim"; package = "bufdelete-nvim";
globalPrefix = "bufdelete_"; globalPrefix = "bufdelete_";
maintainers = [ maintainers.MattSturgeon ]; maintainers = [ lib.maintainers.MattSturgeon ];
description = '' description = ''
Delete Neovim buffers without losing window layout. Delete Neovim buffers without losing window layout.

View file

@ -1,14 +1,10 @@
{ { lib, ... }:
lib,
...
}:
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "chatgpt"; name = "chatgpt";
package = "ChatGPT-nvim"; package = "ChatGPT-nvim";
description = "Effortless Natural Language Generation with OpenAI's ChatGPT API"; description = "Effortless Natural Language Generation with OpenAI's ChatGPT API";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
dependencies = [ "curl" ]; dependencies = [ "curl" ];
@ -30,7 +26,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
''; '';
extra_curl_params = lib.nixvim.defaultNullOpts.mkListOf' { extra_curl_params = lib.nixvim.defaultNullOpts.mkListOf' {
type = types.str; type = lib.types.str;
pluginDefault = null; pluginDefault = null;
description = '' description = ''
Custom cURL parameters can be passed using this option. Custom cURL parameters can be passed using this option.

View file

@ -1,11 +1,10 @@
{ lib, ... }: { lib, ... }:
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "codesnap"; name = "codesnap";
package = "codesnap-nvim"; package = "codesnap-nvim";
description = "Snapshot plugin with rich features that can make pretty code snapshots."; description = "Snapshot plugin with rich features that can make pretty code snapshots.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsExample = { settingsExample = {
save_path = "~/Pictures/Screenshots/"; save_path = "~/Pictures/Screenshots/";

View file

@ -1,15 +1,11 @@
{ { lib, ... }:
lib,
...
}:
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "comment"; name = "comment";
moduleName = "Comment"; moduleName = "Comment";
package = "comment-nvim"; package = "comment-nvim";
description = "Smart and powerful comment plugin for Neovim."; description = "Smart and powerful comment plugin for Neovim.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = { settingsOptions = {
padding = lib.nixvim.defaultNullOpts.mkBool true '' padding = lib.nixvim.defaultNullOpts.mkBool true ''
@ -61,7 +57,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
mappings = mappings =
lib.nixvim.defaultNullOpts.mkNullable lib.nixvim.defaultNullOpts.mkNullable
( (
with types; with lib.types;
either (enum [ false ]) (submodule { either (enum [ false ]) (submodule {
options = { options = {
basic = lib.nixvim.defaultNullOpts.mkBool true '' basic = lib.nixvim.defaultNullOpts.mkBool true ''

View file

@ -3,14 +3,15 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib.nixvim.plugins; inherit (lib) mkOption types;
in
lib.nixvim.plugins.mkVimPlugin { lib.nixvim.plugins.mkVimPlugin {
name = "copilot-vim"; name = "copilot-vim";
globalPrefix = "copilot_"; globalPrefix = "copilot_";
description = "Official Neovim plugin for GitHub Copilot."; description = "Official Neovim plugin for GitHub Copilot.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = { settingsOptions = {
node_command = mkOption { node_command = mkOption {

View file

@ -1,14 +1,13 @@
{ { lib, ... }:
lib, let
... inherit (lib) types;
}: in
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "dashboard"; name = "dashboard";
package = "dashboard-nvim"; package = "dashboard-nvim";
description = "Fancy and Blazing Fast start screen plugin for Neovim."; description = "Fancy and Blazing Fast start screen plugin for Neovim.";
maintainers = [ maintainers.MattSturgeon ]; maintainers = [ lib.maintainers.MattSturgeon ];
settingsExample = { settingsExample = {
theme = "hyper"; theme = "hyper";

View file

@ -1,14 +1,13 @@
{ { lib, ... }:
lib, let
... inherit (lib) mkOption types;
}: in
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "debugprint"; name = "debugprint";
package = "debugprint-nvim"; package = "debugprint-nvim";
description = "A Neovim plugin for inserting debug print statements."; description = "A Neovim plugin for inserting debug print statements.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = { settingsOptions = {
keymaps = keymaps =

View file

@ -1,14 +1,13 @@
{ { lib, ... }:
lib, let
... inherit (lib) mkDefault types;
}: in
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "edgy"; name = "edgy";
package = "edgy-nvim"; package = "edgy-nvim";
description = "A Neovim plugin to easily create and manage predefined window layouts."; description = "A Neovim plugin to easily create and manage predefined window layouts.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
extraConfig = { extraConfig = {
# Those options are strongly recommended by the plugin author: # Those options are strongly recommended by the plugin author:
@ -72,7 +71,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
top = mkViewOptsOption "top"; top = mkViewOptsOption "top";
options = options =
mapAttrs lib.mapAttrs
(_: defaultSize: { (_: defaultSize: {
size = lib.nixvim.defaultNullOpts.mkUnsignedInt defaultSize '' size = lib.nixvim.defaultNullOpts.mkUnsignedInt defaultSize ''
Size of the short edge of the edgebar. Size of the short edge of the edgebar.

View file

@ -1,21 +1,20 @@
{ { lib, ... }:
lib, let
... inherit (lib) recursiveUpdate;
}: in
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "flash"; name = "flash";
package = "flash-nvim"; package = "flash-nvim";
description = "`flash.nvim` lets you navigate your code with search labels, enhanced character motions, and Treesitter integration."; description = "`flash.nvim` lets you navigate your code with search labels, enhanced character motions, and Treesitter integration.";
maintainers = with maintainers; [ maintainers = with lib.maintainers; [
traxys traxys
MattSturgeon MattSturgeon
]; ];
imports = [ imports = [
# TODO: check automatic search config still works # TODO: check automatic search config still works
(mkRemovedOptionModule [ (lib.mkRemovedOptionModule [
"plugins" "plugins"
"flash" "flash"
"search" "search"
@ -25,6 +24,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
settingsOptions = settingsOptions =
let let
inherit (lib) types;
# Default values used for the top-level settings options, # Default values used for the top-level settings options,
# also used as secondary defaults for mode options. # also used as secondary defaults for mode options.
configDefaults = { configDefaults = {
@ -335,7 +335,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
Extmark priority. Extmark priority.
''; '';
groups = mapAttrs (name: lib.nixvim.defaultNullOpts.mkStr defaults.highlight.groups.${name}) { groups = lib.mapAttrs (name: lib.nixvim.defaultNullOpts.mkStr defaults.highlight.groups.${name}) {
# opt = description # opt = description
match = "FlashMatch"; match = "FlashMatch";
current = "FlashCurrent"; current = "FlashCurrent";

View file

@ -3,8 +3,8 @@
lib, lib,
... ...
}: }:
with lib;
let let
inherit (lib) types mkOption;
settingsOptions = { settingsOptions = {
fzf_bin = lib.nixvim.mkNullOrStr '' fzf_bin = lib.nixvim.mkNullOrStr ''
The path to the `fzf` binary to use. The path to the `fzf` binary to use.
@ -32,7 +32,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
name = "fzf-lua"; name = "fzf-lua";
description = "`fzf` powered fuzzy finder for Neovim written in Lua."; description = "`fzf` powered fuzzy finder for Neovim written in Lua.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
inherit settingsOptions settingsExample; inherit settingsOptions settingsExample;
@ -141,11 +141,11 @@ lib.nixvim.plugins.mkNeovimPlugin {
plugins.fzf-lua.settings.__unkeyed_profile = cfg.profile; plugins.fzf-lua.settings.__unkeyed_profile = cfg.profile;
keymaps = mapAttrsToList ( keymaps = lib.mapAttrsToList (
key: mapping: key: mapping:
let let
actionStr = actionStr =
if isString mapping then if lib.isString mapping then
"${mapping}()" "${mapping}()"
else else
"${mapping.action}(${lib.nixvim.toLuaObject mapping.settings})"; "${mapping.action}(${lib.nixvim.toLuaObject mapping.settings})";

View file

@ -1,14 +1,10 @@
{ { lib, ... }:
lib,
...
}:
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "git-conflict"; name = "git-conflict";
package = "git-conflict-nvim"; package = "git-conflict-nvim";
description = "A plugin to visualise and resolve merge conflicts in neovim."; description = "A plugin to visualise and resolve merge conflicts in neovim.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
dependencies = [ "git" ]; dependencies = [ "git" ];
@ -22,7 +18,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
settingsOptions = { settingsOptions = {
default_mappings = default_mappings =
lib.nixvim.defaultNullOpts.mkNullable (with types; either bool (attrsOf str)) true lib.nixvim.defaultNullOpts.mkNullable (with lib.types; either bool (attrsOf str)) true
'' ''
This plugin offers default buffer local mappings inside conflicted files. This plugin offers default buffer local mappings inside conflicted files.
This is primarily because applying these mappings only to relevant buffers is impossible This is primarily because applying these mappings only to relevant buffers is impossible

View file

@ -1,8 +1,4 @@
{ { lib, ... }:
lib,
...
}:
with lib;
# We use `mkVimPlugin` to avoid having a `settings` option. # We use `mkVimPlugin` to avoid having a `settings` option.
# Indeed, this plugin is not configurable in the common sense (no `setup` function). # Indeed, this plugin is not configurable in the common sense (no `setup` function).
lib.nixvim.plugins.mkVimPlugin { lib.nixvim.plugins.mkVimPlugin {
@ -10,12 +6,12 @@ lib.nixvim.plugins.mkVimPlugin {
package = "gitignore-nvim"; package = "gitignore-nvim";
description = "A Neovim plugin for generating .gitignore files."; description = "A Neovim plugin for generating .gitignore files.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
extraOptions = { extraOptions = {
keymap = mkOption { keymap = lib.mkOption {
type = type =
with types; with lib.types;
nullOr ( nullOr (
either str (submodule { either str (submodule {
options = { options = {
@ -44,9 +40,9 @@ lib.nixvim.plugins.mkVimPlugin {
}; };
extraConfig = cfg: { extraConfig = cfg: {
keymaps = optional (cfg.keymap != null) ( keymaps = lib.optional (cfg.keymap != null) (
( (
if isString cfg.keymap then if lib.isString cfg.keymap then
{ {
mode = "n"; mode = "n";
key = cfg.keymap; key = cfg.keymap;

View file

@ -1,15 +1,11 @@
{ { lib, ... }:
lib,
...
}:
with lib;
lib.nixvim.plugins.mkVimPlugin { lib.nixvim.plugins.mkVimPlugin {
name = "godot"; name = "godot";
package = "vim-godot"; package = "vim-godot";
globalPrefix = "godot_"; globalPrefix = "godot_";
description = "A Neovim plugin for Godot game engine integration."; description = "A Neovim plugin for Godot game engine integration.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
dependencies = [ "godot" ]; dependencies = [ "godot" ];

View file

@ -1,16 +1,14 @@
{ { lib, ... }:
lib, let
... inherit (lib) types;
}: in
with lib.nixvim.plugins; lib.nixvim.plugins.mkVimPlugin {
with lib;
mkVimPlugin {
name = "goyo"; name = "goyo";
package = "goyo-vim"; package = "goyo-vim";
globalPrefix = "goyo_"; globalPrefix = "goyo_";
description = "Distraction-free writing in Vim."; description = "Distraction-free writing in Vim.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = { settingsOptions = {
width = lib.nixvim.mkNullOrOption types.ints.unsigned "width"; width = lib.nixvim.mkNullOrOption types.ints.unsigned "width";

View file

@ -1,14 +1,10 @@
{ { lib, ... }:
lib,
...
}:
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "hydra"; name = "hydra";
package = "hydra-nvim"; package = "hydra-nvim";
description = "Create custom submodes and menus, inspired by the Hydra Emacs package."; description = "Create custom submodes and menus, inspired by the Hydra Emacs package.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
extraOptions = { extraOptions = {
# A list of `Hydra` definitions # A list of `Hydra` definitions

View file

@ -1,6 +1,6 @@
{ lib }: { lib }:
with lib;
let let
inherit (lib) types;
hydraType = types.submodule { hydraType = types.submodule {
freeformType = with types; attrsOf anything; freeformType = with types; attrsOf anything;
options = { options = {
@ -109,7 +109,7 @@ let
}; };
}; };
in in
mkOption { lib.mkOption {
type = types.listOf hydraType; type = types.listOf hydraType;
default = [ ]; default = [ ];
description = '' description = ''

View file

@ -6,7 +6,9 @@
# #
# -> https://github.com/nvimtools/hydra.nvim?tab=readme-ov-file#config # -> https://github.com/nvimtools/hydra.nvim?tab=readme-ov-file#config
{ lib, ... }: { lib, ... }:
with lib; let
inherit (lib) types;
in
{ {
debug = lib.nixvim.defaultNullOpts.mkBool false '' debug = lib.nixvim.defaultNullOpts.mkBool false ''
Whether to enable debug mode. Whether to enable debug mode.
@ -128,7 +130,7 @@ with lib;
close it with `Hydra.hint:close()`. close it with `Hydra.hint:close()`.
''; '';
funcs = mkOption { funcs = lib.mkOption {
type = with lib.types; attrsOf strLuaFn; type = with lib.types; attrsOf strLuaFn;
description = '' description = ''
Table from function names to function. Table from function names to function.

View file

@ -1,16 +1,15 @@
{ { lib, ... }:
lib,
...
}:
with lib;
# This plugin is only configured through keymaps, so we use `mkVimPlugin` without the # This plugin is only configured through keymaps, so we use `mkVimPlugin` without the
# `globalPrefix` argument to avoid the creation of the `settings` option. # `globalPrefix` argument to avoid the creation of the `settings` option.
let
inherit (lib) mkOption;
in
lib.nixvim.plugins.mkVimPlugin { lib.nixvim.plugins.mkVimPlugin {
name = "improved-search"; name = "improved-search";
package = "improved-search-nvim"; package = "improved-search-nvim";
description = "It's a Neovim plugin that improves the search experience."; description = "It's a Neovim plugin that improves the search experience.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
extraOptions = { extraOptions = {
keymaps = mkOption { keymaps = mkOption {
@ -115,7 +114,7 @@ lib.nixvim.plugins.mkVimPlugin {
inherit (keymap) key options mode; inherit (keymap) key options mode;
action = action =
if if
isString keymap.action lib.isString keymap.action
# One of the plugin builtin functions # One of the plugin builtin functions
then then
lib.nixvim.mkRaw "require('improved-search').${keymap.action}" lib.nixvim.mkRaw "require('improved-search').${keymap.action}"

View file

@ -1,16 +1,11 @@
{ { lib, ... }:
lib, lib.nixvim.plugins.mkVimPlugin {
...
}:
with lib;
with lib.nixvim.plugins;
mkVimPlugin {
name = "instant"; name = "instant";
package = "instant-nvim"; package = "instant-nvim";
globalPrefix = "instant_"; globalPrefix = "instant_";
description = "A Neovim plugin for collaborative editing."; description = "A Neovim plugin for collaborative editing.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = { settingsOptions = {
username = lib.nixvim.mkNullOrStr '' username = lib.nixvim.mkNullOrStr ''

View file

@ -1,7 +1,4 @@
{ { lib, ... }:
lib,
...
}:
let let
# The keys are the option name in nixvim (under plugins.julia-cell.keymaps) # The keys are the option name in nixvim (under plugins.julia-cell.keymaps)
# cmd: Such that the mapping action is ':JuliaCell${cmd}<CR>' # cmd: Such that the mapping action is ':JuliaCell${cmd}<CR>'
@ -33,14 +30,13 @@ let
}; };
}; };
in in
with lib;
lib.nixvim.plugins.mkVimPlugin { lib.nixvim.plugins.mkVimPlugin {
name = "julia-cell"; name = "julia-cell";
package = "vim-julia-cell"; package = "vim-julia-cell";
globalPrefix = "julia_cell_"; globalPrefix = "julia_cell_";
description = "A Vim plugin for executing Julia code cells."; description = "A Vim plugin for executing Julia code cells.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = { settingsOptions = {
delimit_cells_by = delimit_cells_by =
@ -58,25 +54,25 @@ lib.nixvim.plugins.mkVimPlugin {
extraOptions = { extraOptions = {
keymaps = { keymaps = {
silent = mkOption { silent = lib.mkOption {
type = types.bool; type = lib.types.bool;
description = "Whether julia-cell keymaps should be silent"; description = "Whether julia-cell keymaps should be silent";
default = false; default = false;
}; };
} }
// (mapAttrs ( // (lib.mapAttrs (
name: value: lib.nixvim.mkNullOrOption types.str "Keymap for ${value.desc}." name: value: lib.nixvim.mkNullOrOption lib.types.str "Keymap for ${value.desc}."
) mappings); ) mappings);
}; };
extraConfig = cfg: { extraConfig = cfg: {
keymaps = flatten ( keymaps = lib.flatten (
mapAttrsToList ( lib.mapAttrsToList (
name: value: name: value:
let let
key = cfg.keymaps.${name}; key = cfg.keymaps.${name};
in in
optional (key != null) { lib.optional (key != null) {
mode = "n"; mode = "n";
inherit key; inherit key;
action = ":JuliaCell${value.cmd}<CR>"; action = ":JuliaCell${value.cmd}<CR>";

View file

@ -1,5 +1,4 @@
{ lib, ... }: { lib, ... }:
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "lsp-lines"; name = "lsp-lines";
moduleName = "lsp_lines"; moduleName = "lsp_lines";
@ -9,10 +8,10 @@ lib.nixvim.plugins.mkNeovimPlugin {
# This plugin has no settings; it is configured via vim.diagnostic.config # This plugin has no settings; it is configured via vim.diagnostic.config
hasSettings = false; hasSettings = false;
maintainers = [ maintainers.MattSturgeon ]; maintainers = [ lib.maintainers.MattSturgeon ];
extraConfig = { extraConfig = {
# Strongly recommended by the plugin, to avoid duplication. # Strongly recommended by the plugin, to avoid duplication.
diagnostic.settings.virtual_text = mkDefault false; diagnostic.settings.virtual_text = lib.mkDefault false;
}; };
} }

View file

@ -3,13 +3,12 @@
config, config,
... ...
}: }:
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "ltex-extra"; name = "ltex-extra";
package = "ltex_extra-nvim"; package = "ltex_extra-nvim";
description = "LTeX_extra is a companion plugin for LTeX language server."; description = "LTeX_extra is a companion plugin for LTeX language server.";
maintainers = [ maintainers.loicreynier ]; maintainers = [ lib.maintainers.loicreynier ];
callSetup = false; callSetup = false;
@ -26,7 +25,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
Whether to load dictionaries on startup. Whether to load dictionaries on startup.
''; '';
load_langs = lib.nixvim.defaultNullOpts.mkListOf types.str [ "en-US" ] '' load_langs = lib.nixvim.defaultNullOpts.mkListOf lib.types.str [ "en-US" ] ''
Languages for witch dicionnaries will be loaded. Languages for witch dicionnaries will be loaded.
See `plugins.lsp.servers.ltex.languages` for possible values. See `plugins.lsp.servers.ltex.languages` for possible values.
''; '';

View file

@ -1,16 +1,11 @@
{ { lib, ... }:
lib, lib.nixvim.plugins.mkVimPlugin {
...
}:
with lib;
with lib.nixvim.plugins;
mkVimPlugin {
name = "magma-nvim"; name = "magma-nvim";
package = "magma-nvim"; package = "magma-nvim";
globalPrefix = "magma_"; globalPrefix = "magma_";
description = "Interact with Jupyter from NeoVim."; description = "Interact with Jupyter from NeoVim.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = { settingsOptions = {
image_provider = image_provider =

View file

@ -3,13 +3,15 @@
config, config,
... ...
}: }:
with lib; let
inherit (lib) types;
in
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "neoclip"; name = "neoclip";
package = "nvim-neoclip-lua"; package = "nvim-neoclip-lua";
description = "Clipboard manager neovim plugin with telescope integration."; description = "Clipboard manager neovim plugin with telescope integration.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = { settingsOptions = {
history = lib.nixvim.defaultNullOpts.mkUnsignedInt 1000 '' history = lib.nixvim.defaultNullOpts.mkUnsignedInt 1000 ''

View file

@ -1,18 +1,14 @@
{ { lib, ... }:
lib,
...
}:
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "neoscroll"; name = "neoscroll";
package = "neoscroll-nvim"; package = "neoscroll-nvim";
description = "Smooth scrolling neovim plugin."; description = "Smooth scrolling neovim plugin.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = { settingsOptions = {
mappings = mappings =
lib.nixvim.defaultNullOpts.mkListOf types.str lib.nixvim.defaultNullOpts.mkListOf lib.types.str
[ [
"<C-u>" "<C-u>"
"<C-d>" "<C-d>"

View file

@ -4,7 +4,6 @@
pkgs, pkgs,
... ...
}: }:
with lib;
let let
inherit (lib.nixvim) mkSettingsOption toLuaObject; inherit (lib.nixvim) mkSettingsOption toLuaObject;
supportedAdapters = import ./adapters-list.nix; supportedAdapters = import ./adapters-list.nix;
@ -18,7 +17,7 @@ let
}: }:
{ {
options.plugins.neotest.adapters.${name} = { options.plugins.neotest.adapters.${name} = {
enable = mkEnableOption name; enable = lib.mkEnableOption name;
package = lib.mkPackageOption pkgs name { package = lib.mkPackageOption pkgs name {
default = [ default = [
@ -34,7 +33,7 @@ let
let let
cfg = config.plugins.neotest.adapters.${name}; cfg = config.plugins.neotest.adapters.${name};
in in
mkIf cfg.enable { lib.mkIf cfg.enable {
extraPlugins = [ cfg.package ]; extraPlugins = [ cfg.package ];
assertions = lib.nixvim.mkAssertions "plugins.neotest.adapters.${name}" { assertions = lib.nixvim.mkAssertions "plugins.neotest.adapters.${name}" {
@ -55,12 +54,14 @@ let
plugins.neotest.settings.adapters = plugins.neotest.settings.adapters =
let let
settingsString = optionalString (cfg.settings != { }) (settingsSuffix (toLuaObject cfg.settings)); settingsString = lib.optionalString (cfg.settings != { }) (
settingsSuffix (toLuaObject cfg.settings)
);
in in
[ "require('neotest-${name}')${settingsString}" ]; [ "require('neotest-${name}')${settingsString}" ];
}; };
}; };
in in
{ {
imports = mapAttrsToList mkAdapter supportedAdapters; imports = lib.mapAttrsToList mkAdapter supportedAdapters;
} }

View file

@ -1,19 +1,15 @@
{ { lib, ... }:
lib,
...
}:
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "neotest"; name = "neotest";
description = "An extensible framework for interacting with tests within NeoVim."; description = "An extensible framework for interacting with tests within NeoVim.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
imports = [ ./adapters.nix ]; imports = [ ./adapters.nix ];
settingsOptions = (import ./settings-options.nix { inherit lib; }) // { settingsOptions = (import ./settings-options.nix { inherit lib; }) // {
adapters = mkOption { adapters = lib.mkOption {
type = with types; listOf strLua; type = with lib.types; listOf strLua;
default = [ ]; default = [ ];
# NOTE: We hide this option from the documentation as users should use the top-level # NOTE: We hide this option from the documentation as users should use the top-level
# `adapters` option. # `adapters` option.

View file

@ -1,6 +1,6 @@
{ lib }: { lib }:
with lib;
let let
inherit (lib) types;
inherit (lib.nixvim) defaultNullOpts mkNullOrOption mkNullOrLuaFn; inherit (lib.nixvim) defaultNullOpts mkNullOrOption mkNullOrLuaFn;
in in
{ {

View file

@ -3,12 +3,14 @@
config, config,
... ...
}: }:
with lib; let
inherit (lib) types;
in
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "nvim-autopairs"; name = "nvim-autopairs";
description = "Insert and delete brackets, parens, quotes in pair automatically."; description = "Insert and delete brackets, parens, quotes in pair automatically.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = { settingsOptions = {
disable_filetype = lib.nixvim.defaultNullOpts.mkListOf types.str [ disable_filetype = lib.nixvim.defaultNullOpts.mkListOf types.str [

View file

@ -1,14 +1,13 @@
{ { lib, ... }:
lib, let
... inherit (lib) mkOption types;
}: in
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "qmk"; name = "qmk";
package = "qmk-nvim"; package = "qmk-nvim";
description = "Format qmk and zmk keymaps in Neovim."; description = "Format qmk and zmk keymaps in Neovim.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = { settingsOptions = {
name = mkOption { name = mkOption {

View file

@ -3,16 +3,15 @@
config, config,
... ...
}: }:
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "refactoring"; name = "refactoring";
package = "refactoring-nvim"; package = "refactoring-nvim";
description = "The Refactoring library based off the Refactoring book by Martin Fowler."; description = "The Refactoring library based off the Refactoring book by Martin Fowler.";
maintainers = [ maintainers.MattSturgeon ]; maintainers = [ lib.maintainers.MattSturgeon ];
extraOptions = { extraOptions = {
enableTelescope = mkEnableOption "telescope integration"; enableTelescope = lib.mkEnableOption "telescope integration";
}; };
extraConfig = cfg: { extraConfig = cfg: {
@ -25,7 +24,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
''; '';
}; };
plugins.telescope.enabledExtensions = mkIf cfg.enableTelescope [ "refactoring" ]; plugins.telescope.enabledExtensions = lib.mkIf cfg.enableTelescope [ "refactoring" ];
}; };
settingsOptions = with lib.types; { settingsOptions = with lib.types; {

View file

@ -3,12 +3,11 @@
config, config,
... ...
}: }:
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "rustaceanvim"; name = "rustaceanvim";
description = "A Neovim plugin for Rust development, providing features like LSP support, code navigation, and more."; description = "A Neovim plugin for Rust development, providing features like LSP support, code navigation, and more.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
dependencies = [ "rust-analyzer" ]; dependencies = [ "rust-analyzer" ];
imports = [ imports = [

View file

@ -1,5 +1,7 @@
{ lib }: { lib }:
with lib; let
inherit (lib) types;
in
{ {
tools = tools =
let let
@ -294,7 +296,7 @@ with lib;
freeformType = with types; attrsOf anything; freeformType = with types; attrsOf anything;
options = { options = {
# Common options # Common options
type = mkOption { type = lib.mkOption {
type = types.enum [ type = types.enum [
"executable" "executable"
"server" "server"

View file

@ -1,8 +1,4 @@
{ { lib, ... }:
lib,
...
}:
with lib;
lib.nixvim.plugins.mkVimPlugin { lib.nixvim.plugins.mkVimPlugin {
name = "sandwich"; name = "sandwich";
package = "vim-sandwich"; package = "vim-sandwich";
@ -28,7 +24,7 @@ lib.nixvim.plugins.mkVimPlugin {
``` ```
''; '';
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = { settingsOptions = {
no_default_key_mappings = lib.nixvim.defaultNullOpts.mkFlagInt 0 '' no_default_key_mappings = lib.nixvim.defaultNullOpts.mkFlagInt 0 ''

View file

@ -3,13 +3,20 @@
config, config,
... ...
}: }:
with lib; let
inherit (lib)
types
mkOption
mkIf
mkDefault
;
in
lib.nixvim.plugins.mkVimPlugin { lib.nixvim.plugins.mkVimPlugin {
name = "schemastore"; name = "schemastore";
package = "SchemaStore-nvim"; package = "SchemaStore-nvim";
description = "A Neovim plugin that provides the SchemaStore catalog for use with jsonls and yamlls."; description = "A Neovim plugin that provides the SchemaStore catalog for use with jsonls and yamlls.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
extraOptions = extraOptions =
let let

View file

@ -1,13 +1,12 @@
{ { lib, ... }:
lib, let
... inherit (lib) types literalExpression;
}: in
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "sniprun"; name = "sniprun";
description = "A neovim plugin to run lines/blocs of code."; description = "A neovim plugin to run lines/blocs of code.";
maintainers = with maintainers; [ maintainers = with lib.maintainers; [
traxys traxys
MattSturgeon MattSturgeon
]; ];
@ -147,7 +146,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
''; '';
type = types.submodule { type = types.submodule {
freeformType = types.attrsOf types.anything; freeformType = types.attrsOf types.anything;
options = mapAttrs (optionName: colorOption) { options = lib.mapAttrs (optionName: colorOption) {
SniprunVirtualTextOk = { SniprunVirtualTextOk = {
bg = "#66eeff"; bg = "#66eeff";
fg = "#000000"; fg = "#000000";

View file

@ -1,14 +1,10 @@
{ { lib, ... }:
lib,
...
}:
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "specs"; name = "specs";
package = "specs-nvim"; package = "specs-nvim";
description = "A fast and lightweight Neovim lua plugin to keep an eye on where your cursor has jumped."; description = "A fast and lightweight Neovim lua plugin to keep an eye on where your cursor has jumped.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = { settingsOptions = {
show_jumps = lib.nixvim.defaultNullOpts.mkBool true '' show_jumps = lib.nixvim.defaultNullOpts.mkBool true ''
@ -49,12 +45,12 @@ lib.nixvim.plugins.mkNeovimPlugin {
''; '';
}; };
ignore_filetypes = lib.nixvim.defaultNullOpts.mkAttrsOf types.bool { } '' ignore_filetypes = lib.nixvim.defaultNullOpts.mkAttrsOf lib.types.bool { } ''
An attrs where keys are filetypes and values are a boolean stating whether animation should be An attrs where keys are filetypes and values are a boolean stating whether animation should be
enabled or not for this filetype. enabled or not for this filetype.
''; '';
ignore_buftypes = lib.nixvim.defaultNullOpts.mkAttrsOf types.bool { nofile = true; } '' ignore_buftypes = lib.nixvim.defaultNullOpts.mkAttrsOf lib.types.bool { nofile = true; } ''
An attrs where keys are buftypes and values are a boolean stating whether animation should be An attrs where keys are buftypes and values are a boolean stating whether animation should be
enabled or not for this buftype. enabled or not for this buftype.
''; '';

View file

@ -3,13 +3,15 @@
config, config,
... ...
}: }:
with lib; let
inherit (lib) mkOption types;
in
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "spectre"; name = "spectre";
package = "nvim-spectre"; package = "nvim-spectre";
description = "A search panel for neovim."; description = "A search panel for neovim.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
imports = [ imports = [
# TODO: added 2025-04-07, remove after 25.05 # TODO: added 2025-04-07, remove after 25.05

View file

@ -1,16 +1,11 @@
{ { lib, ... }:
lib, lib.nixvim.plugins.mkVimPlugin {
...
}:
with lib;
with lib.nixvim.plugins;
mkVimPlugin {
name = "startify"; name = "startify";
package = "vim-startify"; package = "vim-startify";
globalPrefix = "startify_"; globalPrefix = "startify_";
description = "The fancy start screen for Vim."; description = "The fancy start screen for Vim.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = import ./settings-options.nix { inherit lib; }; settingsOptions = import ./settings-options.nix { inherit lib; };

View file

@ -1,5 +1,7 @@
{ lib }: { lib }:
with lib; let
inherit (lib) mkOption types;
in
{ {
session_dir = lib.nixvim.defaultNullOpts.mkStr "~/.vim/session" '' session_dir = lib.nixvim.defaultNullOpts.mkStr "~/.vim/session" ''
The directory to save/load sessions to/from. The directory to save/load sessions to/from.

View file

@ -1,14 +1,13 @@
{ { lib, ... }:
lib, let
... inherit (lib) types mkOption;
}: in
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "statuscol"; name = "statuscol";
package = "statuscol-nvim"; package = "statuscol-nvim";
description = "Status column plugin that provides a configurable `statuscolumn` and click handlers."; description = "Status column plugin that provides a configurable `statuscolumn` and click handlers.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = { settingsOptions = {
setopt = lib.nixvim.defaultNullOpts.mkBool true '' setopt = lib.nixvim.defaultNullOpts.mkBool true ''

View file

@ -3,8 +3,8 @@
config, config,
... ...
}: }:
with lib;
let let
inherit (lib) types mkOption;
inherit (lib.nixvim) inherit (lib.nixvim)
keymaps keymaps
mkNullOrOption mkNullOrOption
@ -17,7 +17,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
package = "telescope-nvim"; package = "telescope-nvim";
description = "Find, Filter, Preview, Pick. All lua, all the time."; description = "Find, Filter, Preview, Pick. All lua, all the time.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
imports = [ imports = [
./extensions ./extensions
@ -62,7 +62,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
type = types.nullOr types.str; type = types.nullOr types.str;
description = "The colorscheme to use for syntax highlighting"; description = "The colorscheme to use for syntax highlighting";
default = config.colorscheme; default = config.colorscheme;
defaultText = literalExpression "config.colorscheme"; defaultText = lib.literalExpression "config.colorscheme";
}; };
enabledExtensions = mkOption { enabledExtensions = mkOption {
@ -86,7 +86,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
callSetup = false; callSetup = false;
extraConfig = cfg: { extraConfig = cfg: {
# TODO: added 2024-09-20 remove after 24.11 # TODO: added 2024-09-20 remove after 24.11
plugins.web-devicons = mkIf ( plugins.web-devicons = lib.mkIf (
!( !(
( (
config.plugins.mini.enable config.plugins.mini.enable
@ -95,16 +95,16 @@ lib.nixvim.plugins.mkNeovimPlugin {
) )
|| (config.plugins.mini-icons.enable && config.plugins.mini-icons.mockDevIcons) || (config.plugins.mini-icons.enable && config.plugins.mini-icons.mockDevIcons)
) )
) { enable = mkOverride 1490 true; }; ) { enable = lib.mkOverride 1490 true; };
extraConfigVim = mkIf (cfg.highlightTheme != null) '' extraConfigVim = lib.mkIf (cfg.highlightTheme != null) ''
let $BAT_THEME = '${cfg.highlightTheme}' let $BAT_THEME = '${cfg.highlightTheme}'
''; '';
keymaps = mapAttrsToList ( keymaps = lib.mapAttrsToList (
key: mapping: key: mapping:
let let
actionStr = if isString mapping then mapping else mapping.action; actionStr = if lib.isString mapping then mapping else mapping.action;
in in
{ {
mode = mapping.mode or "n"; mode = mapping.mode or "n";

View file

@ -1,6 +1,6 @@
{ lib, ... }: { lib, ... }:
with lib;
let let
inherit (lib) types;
inherit (import ./_helpers.nix lib) mkMappingsOption; inherit (import ./_helpers.nix lib) mkMappingsOption;
mkExtension = import ./_mk-extension.nix; mkExtension = import ./_mk-extension.nix;
inherit (lib.nixvim) defaultNullOpts mkNullOrStr; inherit (lib.nixvim) defaultNullOpts mkNullOrStr;

View file

@ -1,6 +1,6 @@
{ lib, ... }: { lib, ... }:
with lib;
let let
inherit (lib) types;
inherit (lib.nixvim) defaultNullOpts mkNullOrOption mkNullOrStr; inherit (lib.nixvim) defaultNullOpts mkNullOrOption mkNullOrStr;
mkExtension = import ./_mk-extension.nix; mkExtension = import ./_mk-extension.nix;
in in

View file

@ -1,8 +1,4 @@
{ { lib, ... }:
lib,
...
}:
with lib;
let let
inherit (lib.nixvim) defaultNullOpts mkSettingsRenamedOptionModules; inherit (lib.nixvim) defaultNullOpts mkSettingsRenamedOptionModules;
mkExtension = import ./_mk-extension.nix; mkExtension = import ./_mk-extension.nix;
@ -60,7 +56,7 @@ mkExtension {
dependencies = [ "chafa" ]; dependencies = [ "chafa" ];
settingsOptions = { settingsOptions = {
filetypes = defaultNullOpts.mkListOf types.str [ filetypes = defaultNullOpts.mkListOf lib.types.str [
"png" "png"
"jpg" "jpg"
"gif" "gif"

View file

@ -1,6 +1,6 @@
{ lib, ... }: { lib, ... }:
with lib;
let let
inherit (lib) types;
inherit (lib.nixvim) defaultNullOpts mkNullOrOption; inherit (lib.nixvim) defaultNullOpts mkNullOrOption;
inherit (import ./_helpers.nix lib) mkMappingsOption; inherit (import ./_helpers.nix lib) mkMappingsOption;
mkExtension = import ./_mk-extension.nix; mkExtension = import ./_mk-extension.nix;

View file

@ -1,8 +1,4 @@
{ { lib, ... }:
lib,
...
}:
with lib;
# This plugin has no configuration, so we use `mkVimPlugin` without the `globalPrefix` argument to # This plugin has no configuration, so we use `mkVimPlugin` without the `globalPrefix` argument to
# avoid the creation of the `settings` option. # avoid the creation of the `settings` option.
lib.nixvim.plugins.mkVimPlugin { lib.nixvim.plugins.mkVimPlugin {
@ -10,7 +6,7 @@ lib.nixvim.plugins.mkVimPlugin {
package = "texpresso-vim"; package = "texpresso-vim";
description = "Neovim mode for TeXpresso."; description = "Neovim mode for TeXpresso.";
maintainers = [ maintainers.nickhu ]; maintainers = [ lib.maintainers.nickhu ];
dependencies = [ "texpresso" ]; dependencies = [ "texpresso" ];

View file

@ -2,13 +2,15 @@
lib, lib,
... ...
}: }:
with lib; let
inherit (lib) types;
in
lib.nixvim.plugins.mkVimPlugin { lib.nixvim.plugins.mkVimPlugin {
name = "tmux-navigator"; name = "tmux-navigator";
package = "vim-tmux-navigator"; package = "vim-tmux-navigator";
globalPrefix = "tmux_navigator_"; globalPrefix = "tmux_navigator_";
maintainers = [ maintainers.MattSturgeon ]; maintainers = [ lib.maintainers.MattSturgeon ];
description = '' description = ''
Seamless navigation between tmux panes and vim splits. Seamless navigation between tmux panes and vim splits.
@ -161,7 +163,7 @@ lib.nixvim.plugins.mkVimPlugin {
}; };
extraOptions = { extraOptions = {
keymaps = mkOption { keymaps = lib.mkOption {
description = '' description = ''
Keymaps for the `:TmuxNavigate*` commands. Keymaps for the `:TmuxNavigate*` commands.

View file

@ -3,9 +3,8 @@
config, config,
... ...
}: }:
with lib;
let let
inherit (lib) types; inherit (lib) types mkOption optionalString;
inherit (lib.nixvim) inherit (lib.nixvim)
defaultNullOpts defaultNullOpts
keymaps keymaps
@ -272,7 +271,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
extraOptions = { extraOptions = {
keymaps = keymaps =
mapAttrs lib.mapAttrs
( (
optionName: action: optionName: action:
mkNullOrOption' { mkNullOrOption' {
@ -335,8 +334,8 @@ lib.nixvim.plugins.mkNeovimPlugin {
]; ];
keymaps = lib.pipe cfg.keymaps [ keymaps = lib.pipe cfg.keymaps [
(filterAttrs (n: keymap: keymap != null && keymap.key != null)) (lib.filterAttrs (n: keymap: keymap != null && keymap.key != null))
(mapAttrsToList ( (lib.mapAttrsToList (
name: keymap: { name: keymap: {
inherit (keymap) key mode options; inherit (keymap) key mode options;
action = action =
@ -344,7 +343,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
cwd = optionalString (keymap.cwd != null) " cwd=${keymap.cwd}"; cwd = optionalString (keymap.cwd != null) " cwd=${keymap.cwd}";
keywords = optionalString ( keywords = optionalString (
keymap.keywords != null && keymap.keywords != [ ] keymap.keywords != null && keymap.keywords != [ ]
) " keywords=${concatStringsSep "," keymap.keywords}"; ) " keywords=${lib.concatStringsSep "," keymap.keywords}";
in in
"<cmd>${keymap.action}${cwd}${keywords}<cr>"; "<cmd>${keymap.action}${cwd}${keywords}<cr>";
} }

View file

@ -1,14 +1,13 @@
{ { lib, ... }:
lib, let
... inherit (lib) types;
}: in
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "transparent"; name = "transparent";
package = "transparent-nvim"; package = "transparent-nvim";
description = "Remove all background colors to make Neovim transparent."; description = "Remove all background colors to make Neovim transparent.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = { settingsOptions = {
groups = groups =

View file

@ -4,8 +4,15 @@
options, options,
... ...
}: }:
with lib;
let let
inherit (lib)
types
mkOption
literalExpression
optionalString
mkIf
mkDefault
;
buildGrammarDeps = [ buildGrammarDeps = [
"gcc" "gcc"
"nodejs" "nodejs"
@ -334,7 +341,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
}; };
extraOptions = { extraOptions = {
folding = mkEnableOption "tree-sitter based folding"; folding = lib.mkEnableOption "tree-sitter based folding";
grammarPackages = mkOption { grammarPackages = mkOption {
type = with types; listOf package; type = with types; listOf package;
@ -346,7 +353,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
# TODO: Implement rawLua support to be passed into extraConfigLua. # TODO: Implement rawLua support to be passed into extraConfigLua.
languageRegister = mkOption { languageRegister = mkOption {
type = with types; attrsOf (coercedTo str toList (listOf str)); type = with types; attrsOf (coercedTo str lib.toList (listOf str));
default = { }; default = { };
example = { example = {
cpp = "onelab"; cpp = "onelab";

View file

@ -3,14 +3,16 @@
config, config,
... ...
}: }:
with lib; let
inherit (lib) types;
in
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "ts-autotag"; name = "ts-autotag";
moduleName = "nvim-ts-autotag"; moduleName = "nvim-ts-autotag";
package = "nvim-ts-autotag"; package = "nvim-ts-autotag";
description = "Use treesitter to auto close and auto rename a html tag."; description = "Use treesitter to auto close and auto rename a html tag.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
extraConfig = { extraConfig = {
warnings = lib.nixvim.mkWarnings "plugins.ts-autotag" { warnings = lib.nixvim.mkWarnings "plugins.ts-autotag" {

View file

@ -3,13 +3,15 @@
config, config,
... ...
}: }:
with lib; let
inherit (lib) types;
in
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "twilight"; name = "twilight";
package = "twilight-nvim"; package = "twilight-nvim";
description = "Twilight is a Lua plugin for Neovim that dims inactive portions of the code you're editing using TreeSitter."; description = "Twilight is a Lua plugin for Neovim that dims inactive portions of the code you're editing using TreeSitter.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = { settingsOptions = {
dimming = { dimming = {

View file

@ -2,13 +2,15 @@
lib, lib,
... ...
}: }:
with lib; let
inherit (lib) types;
in
lib.nixvim.plugins.mkVimPlugin { lib.nixvim.plugins.mkVimPlugin {
name = "typst-vim"; name = "typst-vim";
globalPrefix = "typst_"; globalPrefix = "typst_";
description = "A Neovim plugin for Typst, a modern typesetting system."; description = "A Neovim plugin for Typst, a modern typesetting system.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
imports = [ imports = [
# TODO: added 2025-04-07, remove after 25.05 # TODO: added 2025-04-07, remove after 25.05
@ -22,7 +24,7 @@ lib.nixvim.plugins.mkVimPlugin {
extraOptions = { extraOptions = {
keymaps = { keymaps = {
silent = mkOption { silent = lib.mkOption {
type = types.bool; type = types.bool;
description = "Whether typst-vim keymaps should be silent."; description = "Whether typst-vim keymaps should be silent.";
default = false; default = false;
@ -41,7 +43,7 @@ lib.nixvim.plugins.mkVimPlugin {
options.silent = silent; options.silent = silent;
} }
( (
optional (watch != null) { lib.optional (watch != null) {
# mode = "n"; # mode = "n";
key = watch; key = watch;
action = ":TypstWatch<CR>"; action = ":TypstWatch<CR>";

View file

@ -1,11 +1,10 @@
{ lib, ... }: { lib, ... }:
with lib;
lib.nixvim.plugins.mkVimPlugin { lib.nixvim.plugins.mkVimPlugin {
name = "undotree"; name = "undotree";
globalPrefix = "undotree_"; globalPrefix = "undotree_";
description = "The undo history visualizer for Vim."; description = "The undo history visualizer for Vim.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsExample = { settingsExample = {
WindowLayout = 4; WindowLayout = 4;

View file

@ -1,15 +1,10 @@
{ { lib, ... }:
lib, lib.nixvim.plugins.mkVimPlugin {
...
}:
with lib;
with lib.nixvim.plugins;
mkVimPlugin {
name = "vim-slime"; name = "vim-slime";
globalPrefix = "slime_"; globalPrefix = "slime_";
description = "Send text from Vim to a terminal or REPL. Inspired by Emacs' `slime`."; description = "Send text from Vim to a terminal or REPL. Inspired by Emacs' `slime`.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = { settingsOptions = {
target = lib.nixvim.defaultNullOpts.mkEnum [ target = lib.nixvim.defaultNullOpts.mkEnum [

View file

@ -1,15 +1,14 @@
{ lib, pkgs, ... }: { lib, pkgs, ... }:
with lib;
lib.nixvim.plugins.mkVimPlugin { lib.nixvim.plugins.mkVimPlugin {
name = "vimtex"; name = "vimtex";
globalPrefix = "vimtex_"; globalPrefix = "vimtex_";
description = "A modern Vim and Neovim plugin for writing LaTeX documents."; description = "A modern Vim and Neovim plugin for writing LaTeX documents.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = { settingsOptions = {
view_method = mkOption { view_method = lib.mkOption {
type = types.str; type = lib.types.str;
default = "general"; default = "general";
example = "zathura"; example = "zathura";
description = '' description = ''
@ -64,7 +63,7 @@ lib.nixvim.plugins.mkVimPlugin {
extraPackages = extraPackages =
let let
# xdotool does not exist on darwin # xdotool does not exist on darwin
xdotool = optional pkgs.stdenv.isLinux cfg.xdotoolPackage; xdotool = lib.optional pkgs.stdenv.isLinux cfg.xdotoolPackage;
viewerPackages = viewerPackages =
{ {
general = xdotool; general = xdotool;

View file

@ -3,8 +3,9 @@
pkgs, pkgs,
... ...
}: }:
with lib;
let let
inherit (lib) types;
keymapsDefinitions = { keymapsDefinitions = {
clear = { clear = {
default = "<C-]>"; default = "<C-]>";
@ -38,13 +39,13 @@ lib.nixvim.plugins.mkVimPlugin {
globalPrefix = "codeium_"; globalPrefix = "codeium_";
description = "Free, ultrafast Copilot alternative for Vim and Neovim."; description = "Free, ultrafast Copilot alternative for Vim and Neovim.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
# TODO: introduced 2025-04-19 # TODO: introduced 2025-04-19
inherit ((import ./deprecations.nix { inherit lib; })) imports; inherit ((import ./deprecations.nix { inherit lib; })) imports;
settingsOptions = { settingsOptions = {
bin = mkOption { bin = lib.mkOption {
type = with types; nullOr str; type = with types; nullOr str;
default = lib.getExe' pkgs.codeium "codeium_language_server"; default = lib.getExe' pkgs.codeium "codeium_language_server";
defaultText = lib.literalExpression ''lib.getExe' pkgs.codeium "codeium_language_server"''; defaultText = lib.literalExpression ''lib.getExe' pkgs.codeium "codeium_language_server"'';
@ -93,7 +94,7 @@ lib.nixvim.plugins.mkVimPlugin {
}; };
extraOptions = { extraOptions = {
keymaps = mapAttrs ( keymaps = lib.mapAttrs (
optionName: v: optionName: v:
lib.nixvim.defaultNullOpts.mkStr v.default '' lib.nixvim.defaultNullOpts.mkStr v.default ''
${v.description} ${v.description}
@ -109,7 +110,7 @@ lib.nixvim.plugins.mkVimPlugin {
let let
processKeymap = processKeymap =
optionName: v: optionName: v:
optional (v != null) { lib.optional (v != null) {
key = v; key = v;
action = action =
let let
@ -118,7 +119,7 @@ lib.nixvim.plugins.mkVimPlugin {
lib.nixvim.mkRaw "function() ${command} end"; lib.nixvim.mkRaw "function() ${command} end";
}; };
keymapsList = flatten (mapAttrsToList processKeymap cfg.keymaps); keymapsList = lib.flatten (lib.mapAttrsToList processKeymap cfg.keymaps);
defaults = { defaults = {
mode = "i"; mode = "i";

View file

@ -3,13 +3,12 @@
config, config,
... ...
}: }:
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "yanky"; name = "yanky";
package = "yanky-nvim"; package = "yanky-nvim";
description = "Improved Yank and Put functionalities for Neovim."; description = "Improved Yank and Put functionalities for Neovim.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsDescription = '' settingsDescription = ''
Options provided to the `require('yanky').setup` function. Options provided to the `require('yanky').setup` function.
@ -74,7 +73,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
cursor or content changed. cursor or content changed.
''; '';
ignore_registers = lib.nixvim.defaultNullOpts.mkListOf types.str [ "_" ] '' ignore_registers = lib.nixvim.defaultNullOpts.mkListOf lib.types.str [ "_" ] ''
Define registers to be ignored. Define registers to be ignored.
By default the black hole register is ignored. By default the black hole register is ignored.
''; '';
@ -111,14 +110,14 @@ lib.nixvim.plugins.mkNeovimPlugin {
apply = apply =
mappings: mappings:
lib.nixvim.ifNonNull' mappings ( lib.nixvim.ifNonNull' mappings (
mapAttrs ( lib.mapAttrs (
_: v: _: v:
if isString v then if lib.isString v then
# `mappings.default` is a lua function # `mappings.default` is a lua function
lib.nixvim.mkRaw v lib.nixvim.mkRaw v
else else
# `mappings.<mode>` is an attrs of lua function # `mappings.<mode>` is an attrs of lua function
mapAttrs (_: lib.nixvim.mkRaw) v lib.mapAttrs (_: lib.nixvim.mkRaw) v
) mappings ) mappings
); );
pluginDefault = null; pluginDefault = null;
@ -233,7 +232,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
}; };
extraOptions = { extraOptions = {
enableTelescope = mkEnableOption "the `yank_history` telescope picker."; enableTelescope = lib.mkEnableOption "the `yank_history` telescope picker.";
}; };
callSetup = false; callSetup = false;
@ -257,12 +256,12 @@ lib.nixvim.plugins.mkNeovimPlugin {
plugins.yanky.luaConfig.content = '' plugins.yanky.luaConfig.content = ''
do do
local utils = require('yanky.utils') local utils = require('yanky.utils')
${optionalString config.plugins.telescope.enable "local mapping = require('yanky.telescope.mapping')"} ${lib.optionalString config.plugins.telescope.enable "local mapping = require('yanky.telescope.mapping')"}
require('yanky').setup(${lib.nixvim.toLuaObject cfg.settings}) require('yanky').setup(${lib.nixvim.toLuaObject cfg.settings})
end end
''; '';
plugins.telescope.enabledExtensions = mkIf cfg.enableTelescope [ "yank_history" ]; plugins.telescope.enabledExtensions = lib.mkIf cfg.enableTelescope [ "yank_history" ];
}; };
} }

View file

@ -2,13 +2,12 @@
lib, lib,
... ...
}: }:
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "zen-mode"; name = "zen-mode";
package = "zen-mode-nvim"; package = "zen-mode-nvim";
description = "Distraction-free coding for Neovim."; description = "Distraction-free coding for Neovim.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
# Optionally, explicitly declare some options. You don't have to. # Optionally, explicitly declare some options. You don't have to.
settingsOptions = { settingsOptions = {
@ -58,7 +57,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
- a function that returns the width or the height - a function that returns the width or the height
''; '';
options = lib.nixvim.defaultNullOpts.mkAttrsOf types.anything { } '' options = lib.nixvim.defaultNullOpts.mkAttrsOf lib.types.anything { } ''
By default, no options are changed for the Zen window. By default, no options are changed for the Zen window.
You can set any `vim.wo` option here. You can set any `vim.wo` option here.
@ -78,7 +77,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
}; };
plugins = { plugins = {
options = options =
lib.nixvim.defaultNullOpts.mkAttrsOf types.anything lib.nixvim.defaultNullOpts.mkAttrsOf lib.types.anything
{ {
enabled = true; enabled = true;
ruler = false; ruler = false;

View file

@ -1,16 +1,11 @@
{ { lib, ... }:
lib, lib.nixvim.plugins.mkVimPlugin {
...
}:
with lib;
with lib.nixvim.plugins;
mkVimPlugin {
name = "zig"; name = "zig";
package = "zig-vim"; package = "zig-vim";
globalPrefix = "zig_"; globalPrefix = "zig_";
description = "Vim plugin for the Zig programming language."; description = "Vim plugin for the Zig programming language.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = { settingsOptions = {
fmt_autosave = lib.nixvim.defaultNullOpts.mkFlagInt 1 '' fmt_autosave = lib.nixvim.defaultNullOpts.mkFlagInt 1 ''

View file

@ -3,13 +3,15 @@
config, config,
... ...
}: }:
with lib; let
inherit (lib) types;
in
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "zk"; name = "zk";
package = "zk-nvim"; package = "zk-nvim";
description = "Neovim extension for the [`zk`](https://github.com/zk-org/zk) plain text note-taking assistant."; description = "Neovim extension for the [`zk`](https://github.com/zk-org/zk) plain text note-taking assistant.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
imports = [ imports = [
# TODO: added 2025-04-07, remove after 25.05 # TODO: added 2025-04-07, remove after 25.05
@ -99,7 +101,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
extraConfig = cfg: opts: { extraConfig = cfg: opts: {
warnings = lib.nixvim.mkWarnings "plugins.zk" ( warnings = lib.nixvim.mkWarnings "plugins.zk" (
mapAttrsToList lib.mapAttrsToList
(picker: pluginName: { (picker: pluginName: {
when = (cfg.settings.picker == picker) && !config.plugins.${pluginName}.enable; when = (cfg.settings.picker == picker) && !config.plugins.${pluginName}.enable;
message = '' message = ''

View file

@ -3,11 +3,12 @@
pkgs, pkgs,
... ...
}: }:
with lib;
let let
renamedServers = import ./_renamed.nix; renamedServers = import ./_renamed.nix;
unsupportedServers = lib.importJSON ../../../generated/unsupported-lspconfig-servers.json; unsupportedServers = lib.importJSON ../../../generated/unsupported-lspconfig-servers.json;
inherit (lib) mkOption types;
lspExtraArgs = { lspExtraArgs = {
dartls = { dartls = {
settingsOptions = import ./dartls-settings.nix { inherit lib; }; settingsOptions = import ./dartls-settings.nix { inherit lib; };
@ -56,7 +57,9 @@ let
settings = cfg: { nixd = cfg; }; settings = cfg: { nixd = cfg; };
settingsOptions = import ./nixd-settings.nix { inherit lib; }; settingsOptions = import ./nixd-settings.nix { inherit lib; };
extraConfig = cfg: { extraConfig = cfg: {
extraPackages = optional (cfg.settings.formatting.command == [ "nixpkgs-fmt" ]) pkgs.nixpkgs-fmt; extraPackages = lib.optional (
cfg.settings.formatting.command == [ "nixpkgs-fmt" ]
) pkgs.nixpkgs-fmt;
}; };
}; };
omnisharp = { omnisharp = {
@ -180,7 +183,7 @@ let
}; };
}; };
extraConfig = cfg: { extraConfig = cfg: {
filetype.extension = mkIf (cfg.enable && cfg.autoSetFiletype) { v = "vlang"; }; filetype.extension = lib.mkIf (cfg.enable && cfg.autoSetFiletype) { v = "vlang"; };
}; };
}; };
volar = { volar = {
@ -249,7 +252,7 @@ in
"lsp" "lsp"
"servers" "servers"
]; ];
renameModules = mapAttrsToList ( renameModules = lib.mapAttrsToList (
old: new: lib.mkRenamedOptionModule (baseLspPath ++ [ old ]) (baseLspPath ++ [ new ]) old: new: lib.mkRenamedOptionModule (baseLspPath ++ [ old ]) (baseLspPath ++ [ new ])
) renamedServers; ) renamedServers;
unsupportedModules = map ( unsupportedModules = map (

View file

@ -29,12 +29,11 @@
"codeium" "codeium"
]; ];
in in
with lib; lib.pipe config.cmpSourcePlugins [
pipe config.cmpSourcePlugins [
# All known source names # All known source names
attrNames lib.attrNames
# Filter out disabled sources # Filter out disabled sources
(filter (name: !(elem name disabledSources))) (lib.filter (name: !(lib.elem name disabledSources)))
# Convert names to source attributes # Convert names to source attributes
(map (name: { (map (name: {
inherit name; inherit name;