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, ... }:
with lib;
lib.nixvim.plugins.mkNeovimPlugin {
name = "arrow";
package = "arrow-nvim";
description = "A Neovim plugin to bookmark and navigate through files.";
maintainers = [ maintainers.hmajid2301 ];
maintainers = [ lib.maintainers.hmajid2301 ];
settingsOptions = {
show_icons = lib.nixvim.defaultNullOpts.mkBool false ''
@ -93,7 +92,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
};
window =
lib.nixvim.defaultNullOpts.mkAttrsOf types.anything
lib.nixvim.defaultNullOpts.mkAttrsOf lib.types.anything
{
relative = "editor";
width = "auto";
@ -153,7 +152,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
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
'';
};

View file

@ -1,6 +1,6 @@
{ config, lib, ... }:
with lib;
let
inherit (lib) mkOption types;
inherit (lib.nixvim)
defaultNullOpts
keymaps
@ -66,12 +66,12 @@ lib.nixvim.plugins.mkNeovimPlugin {
package = "barbar-nvim";
description = "A neovim tabline plugin.";
maintainers = [ maintainers.GaetanLepage ];
maintainers = [ lib.maintainers.GaetanLepage ];
extraOptions = {
keymaps = mapAttrs (
keymaps = lib.mapAttrs (
optionName: funcName:
lib.mkOption {
mkOption {
type = v2NullOr (
keymaps.mkMapOptionSubmodule {
defaults = {
@ -90,7 +90,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
extraConfig = cfg: {
# TODO: added 2024-09-20 remove after 24.11
plugins.web-devicons = mkIf (
plugins.web-devicons = lib.mkIf (
!(
(
config.plugins.mini.enable
@ -99,11 +99,11 @@ lib.nixvim.plugins.mkNeovimPlugin {
)
|| (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:
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,
...
}:
with lib;
{ lib, ... }:
let
inherit (lib) types;
in
lib.nixvim.plugins.mkNeovimPlugin {
name = "better-escape";
moduleName = "better_escape";
package = "better-escape-nvim";
description = "A Neovim plugin to quickly exit insert mode without losing your typed text.";
maintainers = [ maintainers.GaetanLepage ];
maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = {
timeout = lib.nixvim.defaultNullOpts.mkStrLuaOr types.ints.unsigned "vim.o.timeoutlen" ''

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,21 +1,20 @@
{
lib,
...
}:
with lib;
{ lib, ... }:
let
inherit (lib) recursiveUpdate;
in
lib.nixvim.plugins.mkNeovimPlugin {
name = "flash";
package = "flash-nvim";
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
MattSturgeon
];
imports = [
# TODO: check automatic search config still works
(mkRemovedOptionModule [
(lib.mkRemovedOptionModule [
"plugins"
"flash"
"search"
@ -25,6 +24,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
settingsOptions =
let
inherit (lib) types;
# Default values used for the top-level settings options,
# also used as secondary defaults for mode options.
configDefaults = {
@ -335,7 +335,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
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
match = "FlashMatch";
current = "FlashCurrent";

View file

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

View file

@ -1,14 +1,10 @@
{
lib,
...
}:
with lib;
{ lib, ... }:
lib.nixvim.plugins.mkNeovimPlugin {
name = "git-conflict";
package = "git-conflict-nvim";
description = "A plugin to visualise and resolve merge conflicts in neovim.";
maintainers = [ maintainers.GaetanLepage ];
maintainers = [ lib.maintainers.GaetanLepage ];
dependencies = [ "git" ];
@ -22,7 +18,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
settingsOptions = {
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 is primarily because applying these mappings only to relevant buffers is impossible

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,5 +1,4 @@
{ lib, ... }:
with lib;
lib.nixvim.plugins.mkNeovimPlugin {
name = "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
hasSettings = false;
maintainers = [ maintainers.MattSturgeon ];
maintainers = [ lib.maintainers.MattSturgeon ];
extraConfig = {
# 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,
...
}:
with lib;
lib.nixvim.plugins.mkNeovimPlugin {
name = "ltex-extra";
package = "ltex_extra-nvim";
description = "LTeX_extra is a companion plugin for LTeX language server.";
maintainers = [ maintainers.loicreynier ];
maintainers = [ lib.maintainers.loicreynier ];
callSetup = false;
@ -26,7 +25,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
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.
See `plugins.lsp.servers.ltex.languages` for possible values.
'';

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -3,16 +3,15 @@
config,
...
}:
with lib;
lib.nixvim.plugins.mkNeovimPlugin {
name = "refactoring";
package = "refactoring-nvim";
description = "The Refactoring library based off the Refactoring book by Martin Fowler.";
maintainers = [ maintainers.MattSturgeon ];
maintainers = [ lib.maintainers.MattSturgeon ];
extraOptions = {
enableTelescope = mkEnableOption "telescope integration";
enableTelescope = lib.mkEnableOption "telescope integration";
};
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; {

View file

@ -3,12 +3,11 @@
config,
...
}:
with lib;
lib.nixvim.plugins.mkNeovimPlugin {
name = "rustaceanvim";
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" ];
imports = [

View file

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

View file

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

View file

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

View file

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

View file

@ -1,14 +1,10 @@
{
lib,
...
}:
with lib;
{ lib, ... }:
lib.nixvim.plugins.mkNeovimPlugin {
name = "specs";
package = "specs-nvim";
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 = {
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
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
enabled or not for this buftype.
'';

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -3,13 +3,15 @@
config,
...
}:
with lib;
let
inherit (lib) types;
in
lib.nixvim.plugins.mkNeovimPlugin {
name = "twilight";
package = "twilight-nvim";
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 = {
dimming = {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -3,13 +3,12 @@
config,
...
}:
with lib;
lib.nixvim.plugins.mkNeovimPlugin {
name = "yanky";
package = "yanky-nvim";
description = "Improved Yank and Put functionalities for Neovim.";
maintainers = [ maintainers.GaetanLepage ];
maintainers = [ lib.maintainers.GaetanLepage ];
settingsDescription = ''
Options provided to the `require('yanky').setup` function.
@ -74,7 +73,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
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.
By default the black hole register is ignored.
'';
@ -111,14 +110,14 @@ lib.nixvim.plugins.mkNeovimPlugin {
apply =
mappings:
lib.nixvim.ifNonNull' mappings (
mapAttrs (
lib.mapAttrs (
_: v:
if isString v then
if lib.isString v then
# `mappings.default` is a lua function
lib.nixvim.mkRaw v
else
# `mappings.<mode>` is an attrs of lua function
mapAttrs (_: lib.nixvim.mkRaw) v
lib.mapAttrs (_: lib.nixvim.mkRaw) v
) mappings
);
pluginDefault = null;
@ -233,7 +232,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
};
extraOptions = {
enableTelescope = mkEnableOption "the `yank_history` telescope picker.";
enableTelescope = lib.mkEnableOption "the `yank_history` telescope picker.";
};
callSetup = false;
@ -257,12 +256,12 @@ lib.nixvim.plugins.mkNeovimPlugin {
plugins.yanky.luaConfig.content = ''
do
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})
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,
...
}:
with lib;
lib.nixvim.plugins.mkNeovimPlugin {
name = "zen-mode";
package = "zen-mode-nvim";
description = "Distraction-free coding for Neovim.";
maintainers = [ maintainers.GaetanLepage ];
maintainers = [ lib.maintainers.GaetanLepage ];
# Optionally, explicitly declare some options. You don't have to.
settingsOptions = {
@ -58,7 +57,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
- 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.
You can set any `vim.wo` option here.
@ -78,7 +77,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
};
plugins = {
options =
lib.nixvim.defaultNullOpts.mkAttrsOf types.anything
lib.nixvim.defaultNullOpts.mkAttrsOf lib.types.anything
{
enabled = true;
ruler = false;

View file

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

View file

@ -3,13 +3,15 @@
config,
...
}:
with lib;
let
inherit (lib) types;
in
lib.nixvim.plugins.mkNeovimPlugin {
name = "zk";
package = "zk-nvim";
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 = [
# TODO: added 2025-04-07, remove after 25.05
@ -99,7 +101,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
extraConfig = cfg: opts: {
warnings = lib.nixvim.mkWarnings "plugins.zk" (
mapAttrsToList
lib.mapAttrsToList
(picker: pluginName: {
when = (cfg.settings.picker == picker) && !config.plugins.${pluginName}.enable;
message = ''

View file

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

View file

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