helpers/vim-plugin: mkPlugin -> mkVimPlugin

This commit is contained in:
Gaetan Lepage 2024-01-25 14:32:49 +01:00 committed by Gaétan Lepage
parent 8f90372ee5
commit a68ee73947
21 changed files with 21 additions and 21 deletions

View file

@ -71,7 +71,7 @@ You will then need to add Nix options for all (or most) of the upstream plugin o
These options should be in `camelCase` (whereas most plugins define their options in `snake_case`), and their names should match exactly (except the case) to the upstream names. These options should be in `camelCase` (whereas most plugins define their options in `snake_case`), and their names should match exactly (except the case) to the upstream names.
There are a number of helpers to help you correctly implement them: There are a number of helpers to help you correctly implement them:
- `helpers.vim-plugin.mkPlugin`: This helper is useful for simple plugins that are configured through (vim) global variables. - `helpers.vim-plugin.mkVimPlugin`: This helper is useful for simple plugins that are configured through (vim) global variables.
- `helpers.defaultNullOpts.{mkBool,mkInt,mkStr,...}`: This family of helpers takes a default value and a description, and sets the Nix default to `null`. These are the main functions you should use to define options. - `helpers.defaultNullOpts.{mkBool,mkInt,mkStr,...}`: This family of helpers takes a default value and a description, and sets the Nix default to `null`. These are the main functions you should use to define options.
- `helpers.defaultNullOpts.mkNullable`: This takes a type, a default and a description. This is useful for more complex options. - `helpers.defaultNullOpts.mkNullable`: This takes a type, a default and a description. This is useful for more complex options.
- `helpers.nixvimTypes.rawLua`: A type to represent raw lua code. The values are of the form `{ __raw = "<code>";}`. This should not be used if the option can only be raw lua code, `mkLua`/`mkLuaFn` should be used in this case. - `helpers.nixvimTypes.rawLua`: A type to represent raw lua code. The values are of the form `{ __raw = "<code>";}`. This should not be used if the option can only be raw lua code, `mkLua`/`mkLuaFn` should be used in this case.

View file

@ -3,7 +3,7 @@
mkPackageOption, mkPackageOption,
}: }:
with lib; { with lib; {
mkPlugin = { mkVimPlugin = {
config, config,
lib, lib,
... ...

View file

@ -6,7 +6,7 @@
with lib; with lib;
( (
with (import ../helpers.nix {inherit lib;}).vim-plugin; with (import ../helpers.nix {inherit lib;}).vim-plugin;
mkPlugin args { mkVimPlugin args {
name = "copilot-vim"; name = "copilot-vim";
description = "copilot.vim"; description = "copilot.vim";
package = pkgs.vimPlugins.copilot-vim; package = pkgs.vimPlugins.copilot-vim;

View file

@ -14,7 +14,7 @@ in
useDefaultPackage ? true, useDefaultPackage ? true,
... ...
}: }:
mkPlugin {inherit lib config pkgs;} { mkVimPlugin {inherit lib config pkgs;} {
inherit name; inherit name;
extraPlugins = extraPlugins ++ (lists.optional useDefaultPackage pkgs.vimPlugins.${name}); extraPlugins = extraPlugins ++ (lists.optional useDefaultPackage pkgs.vimPlugins.${name});
description = "Enable ${name}"; description = "Enable ${name}";

View file

@ -7,7 +7,7 @@
in in
with helpers.vim-plugin; with helpers.vim-plugin;
with lib; with lib;
mkPlugin attrs { mkVimPlugin attrs {
name = "fugitive"; name = "fugitive";
description = "Enable vim-fugitive"; description = "Enable vim-fugitive";
package = pkgs.vimPlugins.vim-fugitive; package = pkgs.vimPlugins.vim-fugitive;

View file

@ -5,7 +5,7 @@
} @ args: } @ args:
with lib; with lib;
with (import ../helpers.nix {inherit lib;}).vim-plugin; with (import ../helpers.nix {inherit lib;}).vim-plugin;
mkPlugin args { mkVimPlugin args {
name = "ledger"; name = "ledger";
description = "ledger language features"; description = "ledger language features";
package = pkgs.vimPlugins.vim-ledger; package = pkgs.vimPlugins.vim-ledger;

View file

@ -6,7 +6,7 @@
} @ args: } @ args:
with lib; with lib;
with (import ../helpers.nix {inherit lib;}).vim-plugin; with (import ../helpers.nix {inherit lib;}).vim-plugin;
mkPlugin args { mkVimPlugin args {
name = "markdown-preview"; name = "markdown-preview";
description = "markdown-preview.nvim"; description = "markdown-preview.nvim";
package = pkgs.vimPlugins.markdown-preview-nvim; package = pkgs.vimPlugins.markdown-preview-nvim;

View file

@ -7,7 +7,7 @@
in in
with helpers.vim-plugin; with helpers.vim-plugin;
with lib; with lib;
mkPlugin attrs { mkVimPlugin attrs {
name = "nix"; name = "nix";
description = "Enable nix"; description = "Enable nix";
package = pkgs.vimPlugins.vim-nix; package = pkgs.vimPlugins.vim-nix;

View file

@ -5,7 +5,7 @@
} @ args: } @ args:
with lib; with lib;
with (import ../helpers.nix {inherit lib;}).vim-plugin; with (import ../helpers.nix {inherit lib;}).vim-plugin;
mkPlugin args { mkVimPlugin args {
name = "tagbar"; name = "tagbar";
package = pkgs.vimPlugins.tagbar; package = pkgs.vimPlugins.tagbar;
globalPrefix = "tagbar_"; globalPrefix = "tagbar_";

View file

@ -7,7 +7,7 @@
in in
with lib; with lib;
with helpers.vim-plugin; with helpers.vim-plugin;
mkPlugin args { mkVimPlugin args {
name = "vim-slime"; name = "vim-slime";
package = pkgs.vimPlugins.vim-slime; package = pkgs.vimPlugins.vim-slime;
globalPrefix = "slime_"; globalPrefix = "slime_";

View file

@ -7,7 +7,7 @@
in in
with helpers.vim-plugin; with helpers.vim-plugin;
with lib; with lib;
mkPlugin attrs { mkVimPlugin attrs {
name = "zig"; name = "zig";
description = "Enable zig"; description = "Enable zig";
package = pkgs.vimPlugins.zig-vim; package = pkgs.vimPlugins.zig-vim;

View file

@ -5,7 +5,7 @@
} @ args: } @ args:
with lib; with lib;
with (import ../helpers.nix {inherit lib;}).vim-plugin; with (import ../helpers.nix {inherit lib;}).vim-plugin;
mkPlugin args { mkVimPlugin args {
name = "airline"; name = "airline";
description = "vim-airline"; description = "vim-airline";
package = pkgs.vimPlugins.vim-airline; package = pkgs.vimPlugins.vim-airline;

View file

@ -12,7 +12,7 @@ with lib; let
either strInt (attrsOf (either strInt (attrsOf strInt))); either strInt (attrsOf (either strInt (attrsOf strInt)));
in in
with helpers.vim-plugin; with helpers.vim-plugin;
mkPlugin attrs { mkVimPlugin attrs {
name = "emmet"; name = "emmet";
description = "Enable emmet"; description = "Enable emmet";
package = pkgs.vimPlugins.emmet-vim; package = pkgs.vimPlugins.emmet-vim;

View file

@ -7,7 +7,7 @@
in in
with helpers.vim-plugin; with helpers.vim-plugin;
with lib; with lib;
mkPlugin attrs { mkVimPlugin attrs {
name = "endwise"; name = "endwise";
description = "Enable vim-endwise"; description = "Enable vim-endwise";
package = pkgs.vimPlugins.vim-endwise; package = pkgs.vimPlugins.vim-endwise;

View file

@ -7,7 +7,7 @@
in in
with helpers.vim-plugin; with helpers.vim-plugin;
with lib; with lib;
mkPlugin attrs { mkVimPlugin attrs {
name = "goyo"; name = "goyo";
description = "Enable goyo.vim"; description = "Enable goyo.vim";
package = pkgs.vimPlugins.goyo-vim; package = pkgs.vimPlugins.goyo-vim;

View file

@ -5,7 +5,7 @@
} @ args: } @ args:
with lib; with lib;
with (import ../helpers.nix {inherit lib;}).vim-plugin; with (import ../helpers.nix {inherit lib;}).vim-plugin;
mkPlugin args { mkVimPlugin args {
name = "instant"; name = "instant";
description = "instant.nvim"; description = "instant.nvim";
package = pkgs.vimPlugins.instant-nvim; package = pkgs.vimPlugins.instant-nvim;

View file

@ -5,7 +5,7 @@
} @ args: } @ args:
with lib; with lib;
with (import ../helpers.nix {inherit lib;}).vim-plugin; with (import ../helpers.nix {inherit lib;}).vim-plugin;
mkPlugin args { mkVimPlugin args {
name = "magma-nvim"; name = "magma-nvim";
description = "magma-nvim"; description = "magma-nvim";
package = pkgs.vimPlugins.magma-nvim-goose; package = pkgs.vimPlugins.magma-nvim-goose;

View file

@ -7,7 +7,7 @@
in in
with lib; with lib;
with helpers.vim-plugin; with helpers.vim-plugin;
mkPlugin args { mkVimPlugin args {
name = "molten"; name = "molten";
description = "molten-nvim"; description = "molten-nvim";
package = pkgs.vimPlugins.molten-nvim; package = pkgs.vimPlugins.molten-nvim;

View file

@ -7,7 +7,7 @@
in in
with lib; with lib;
with helpers.vim-plugin; with helpers.vim-plugin;
mkPlugin args { mkVimPlugin args {
name = "startify"; name = "startify";
description = "Enable startify"; description = "Enable startify";
package = pkgs.vimPlugins.vim-startify; package = pkgs.vimPlugins.vim-startify;

View file

@ -7,7 +7,7 @@
in in
with helpers.vim-plugin; with helpers.vim-plugin;
with lib; with lib;
mkPlugin attrs { mkVimPlugin attrs {
name = "surround"; name = "surround";
description = "Enable surround.vim"; description = "Enable surround.vim";
package = pkgs.vimPlugins.surround; package = pkgs.vimPlugins.surround;

View file

@ -5,7 +5,7 @@
} @ args: } @ args:
with lib; with lib;
with (import ../helpers.nix {inherit lib;}).vim-plugin; with (import ../helpers.nix {inherit lib;}).vim-plugin;
mkPlugin args { mkVimPlugin args {
name = "undotree"; name = "undotree";
package = pkgs.vimPlugins.undotree; package = pkgs.vimPlugins.undotree;
globalPrefix = "undotree_"; globalPrefix = "undotree_";