Skip to content

Commit

Permalink
plugins: migrate defaultPackage -> package
Browse files Browse the repository at this point in the history
Migrate all users of `mkVimPlugin` and `mkNeovimPlugin` to use the new
`package` argument instead of the old `defaultPackage` argument.
  • Loading branch information
MattSturgeon committed Sep 4, 2024
1 parent 285f6cb commit 1fd4b6c
Show file tree
Hide file tree
Showing 148 changed files with 126 additions and 277 deletions.
5 changes: 2 additions & 3 deletions lib/neovim-plugin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ with lib;
colorscheme ? name,
# options
originalName ? name,
# WARNING: `defaultPackage` is deprecated by `package`,
defaultPackage ? throw "mkVimPlugin called without either `package` or `defaultPackage`.",
# Can be a string, a list of strings, or a module option:
# - A string will be intrpreted as `pkgs.vimPlugins.${package}`
# - A list will be interpreted as a "pkgs path", e.g. `pkgs.${elem1}.${elem2}.${etc...}`
# - An option will be used as-is, but should be built using `lib.mkPackageOption`
package ? helpers.mkPluginPackageOption originalName defaultPackage,
# Defaults to `name`, i.e. `pkgs.vimPlugins.${name}`
package ? name,
settingsOptions ? { },
settingsExample ? null,
settingsDescription ? "Options provided to the `require('${luaName}')${setup}` function.",
Expand Down
5 changes: 2 additions & 3 deletions lib/vim-plugin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ with lib;
colorscheme ? name,
# options
originalName ? name,
# WARNING: `defaultPackage` is deprecated by `package`,
defaultPackage ? throw "mkVimPlugin called without either `package` or `defaultPackage`.",
# Can be a string, a list of strings, or a module option:
# - A string will be intrpreted as `pkgs.vimPlugins.${package}`
# - A list will be interpreted as a "pkgs path", e.g. `pkgs.${elem1}.${elem2}.${etc...}`
# - An option will be used as-is, but should be built using `lib.mkPackageOption`
package ? helpers.mkPluginPackageOption originalName defaultPackage,
# Defaults to `name`, i.e. `pkgs.vimPlugins.${name}`
package ? name,
settingsOptions ? { },
settingsExample ? null,
globalPrefix ? "",
Expand Down
2 changes: 1 addition & 1 deletion plugins/ai/chatgpt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ with lib;
helpers.neovim-plugin.mkNeovimPlugin {
name = "chatgpt";
originalName = "ChatGPT.nvim";
defaultPackage = pkgs.vimPlugins.ChatGPT-nvim;
package = "ChatGPT-nvim";

maintainers = [ maintainers.GaetanLepage ];

Expand Down
3 changes: 1 addition & 2 deletions plugins/ai/copilot-chat.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{
lib,
helpers,
pkgs,
...
}:
with lib;
helpers.neovim-plugin.mkNeovimPlugin {
name = "copilot-chat";
originalName = "CopilotChat.nvim";
luaName = "CopilotChat";
defaultPackage = pkgs.vimPlugins.CopilotChat-nvim;
package = "CopilotChat-nvim";

maintainers = [ maintainers.GaetanLepage ];

Expand Down
2 changes: 1 addition & 1 deletion plugins/bufferlines/barbar.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ in
lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "barbar";
originalName = "barbar.nvim";
defaultPackage = pkgs.vimPlugins.barbar-nvim;
package = "barbar-nvim";

maintainers = [ maintainers.GaetanLepage ];

Expand Down
8 changes: 2 additions & 6 deletions plugins/bufferlines/barbecue.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
{
lib,
pkgs,
...
}:
{ lib, ... }:
let
inherit (lib.nixvim) defaultNullOpts;
in
lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "barbecue";
originalName = "barbecue.nvim";
defaultPackage = pkgs.vimPlugins.barbecue-nvim;
package = "barbecue-nvim";

maintainers = [ lib.maintainers.khaneliman ];

Expand Down
2 changes: 1 addition & 1 deletion plugins/bufferlines/bufferline.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ in
lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "bufferline";
originalName = "bufferline.nvim";
defaultPackage = pkgs.vimPlugins.bufferline-nvim;
package = "bufferline-nvim";

maintainers = [ lib.maintainers.khaneliman ];

Expand Down
8 changes: 2 additions & 6 deletions plugins/bufferlines/navic.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
{
lib,
pkgs,
...
}:
{ lib, ... }:
let
inherit (lib.nixvim) defaultNullOpts;
in
lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "navic";
originalName = "nvim-navic";
luaName = "nvim-navic";
defaultPackage = pkgs.vimPlugins.nvim-navic;
package = "nvim-navic";

maintainers = [ lib.maintainers.khaneliman ];

Expand Down
3 changes: 1 addition & 2 deletions plugins/colorschemes/ayu.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
lib,
pkgs,
...
}:
let
Expand All @@ -10,7 +9,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "ayu";
isColorscheme = true;
originalName = "neovim-ayu";
defaultPackage = pkgs.vimPlugins.neovim-ayu;
package = "neovim-ayu";
# The colorscheme option is set by the `setup` function.
colorscheme = null;
callSetup = false;
Expand Down
3 changes: 1 addition & 2 deletions plugins/colorschemes/base16/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
lib,
pkgs,
...
}:
let
Expand All @@ -13,7 +12,7 @@ in
lib.nixvim.neovim-plugin.mkNeovimPlugin {
inherit name luaName originalName;
setup = ".with_config";
defaultPackage = pkgs.vimPlugins.base16-nvim;
package = "base16-nvim";
isColorscheme = true;

maintainers = with lib.maintainers; [
Expand Down
3 changes: 1 addition & 2 deletions plugins/colorschemes/catppuccin.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
lib,
pkgs,
...
}:
let
Expand All @@ -10,7 +9,7 @@ in
lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "catppuccin";
isColorscheme = true;
defaultPackage = pkgs.vimPlugins.catppuccin-nvim;
package = "catppuccin-nvim";

maintainers = [ lib.maintainers.GaetanLepage ];

Expand Down
3 changes: 1 addition & 2 deletions plugins/colorschemes/cyberdream.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
lib,
pkgs,
...
}:
let
Expand All @@ -10,7 +9,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "cyberdream";
isColorscheme = true;
originalName = "cyberdream.nvim";
defaultPackage = pkgs.vimPlugins.cyberdream-nvim;
package = "cyberdream-nvim";

maintainers = [ lib.nixvim.maintainers.AndresBermeoMarinelli ];

Expand Down
7 changes: 1 addition & 6 deletions plugins/colorschemes/dracula-nvim.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
{
lib,
pkgs,
...
}:
{ lib, ... }:
lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "dracula-nvim";
originalName = "dracula.nvim ";
luaName = "dracula";
colorscheme = "dracula";
defaultPackage = pkgs.vimPlugins.dracula-nvim;
isColorscheme = true;

maintainers = [ lib.nixvim.maintainers.refaelsh ];
Expand Down
2 changes: 0 additions & 2 deletions plugins/colorschemes/everforest.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
lib,
pkgs,
...
}:
let
Expand All @@ -17,7 +16,6 @@ in
lib.nixvim.vim-plugin.mkVimPlugin {
name = "everforest";
isColorscheme = true;
defaultPackage = pkgs.vimPlugins.everforest;
globalPrefix = "everforest_";

maintainers = [ lib.nixvim.maintainers.sheemap ];
Expand Down
3 changes: 1 addition & 2 deletions plugins/colorschemes/gruvbox.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
lib,
pkgs,
...
}:
lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "gruvbox";
isColorscheme = true;
originalName = "gruvbox.nvim";
defaultPackage = pkgs.vimPlugins.gruvbox-nvim;
package = "gruvbox-nvim";

maintainers = [ lib.maintainers.GaetanLepage ];

Expand Down
3 changes: 1 addition & 2 deletions plugins/colorschemes/kanagawa.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
lib,
pkgs,
...
}:
let
Expand All @@ -11,7 +10,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "kanagawa";
isColorscheme = true;
originalName = "kanagawa.nvim";
defaultPackage = pkgs.vimPlugins.kanagawa-nvim;
package = "kanagawa-nvim";

description = ''
You can select the theme in two ways:
Expand Down
3 changes: 1 addition & 2 deletions plugins/colorschemes/melange.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
lib,
pkgs,
...
}:
lib.nixvim.vim-plugin.mkVimPlugin {
name = "melange";
isColorscheme = true;
originalName = "melange-nvim";
defaultPackage = pkgs.vimPlugins.melange-nvim;
package = "melange-nvim";

maintainers = [ lib.maintainers.GaetanLepage ];

Expand Down
3 changes: 1 addition & 2 deletions plugins/colorschemes/modus.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
lib,
pkgs,
...
}:
let
Expand All @@ -10,7 +9,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "modus";
luaName = "modus-themes";
originalName = "modus-themes.nvim";
defaultPackage = pkgs.vimPlugins.modus-themes-nvim;
package = "modus-themes-nvim";
isColorscheme = true;

maintainers = [ lib.nixvim.maintainers.nwjsmith ];
Expand Down
3 changes: 1 addition & 2 deletions plugins/colorschemes/nightfox.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
lib,
pkgs,
...
}:
let
Expand All @@ -11,7 +10,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "nightfox";
isColorscheme = true;
originalName = "nightfox.nvim";
defaultPackage = pkgs.vimPlugins.nightfox-nvim;
package = "nightfox-nvim";

maintainers = [ lib.maintainers.GaetanLepage ];

Expand Down
3 changes: 1 addition & 2 deletions plugins/colorschemes/nord.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
lib,
pkgs,
...
}:
let
Expand All @@ -10,7 +9,7 @@ lib.nixvim.vim-plugin.mkVimPlugin {
name = "nord";
isColorscheme = true;
originalName = "nord.nvim";
defaultPackage = pkgs.vimPlugins.nord-nvim;
package = "nord-nvim";
globalPrefix = "nord_";

maintainers = [ lib.maintainers.GaetanLepage ];
Expand Down
3 changes: 1 addition & 2 deletions plugins/colorschemes/one.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
lib,
pkgs,
...
}:
lib.nixvim.vim-plugin.mkVimPlugin {
name = "one";
isColorscheme = true;
originalName = "vim-one";
defaultPackage = pkgs.vimPlugins.vim-one;
package = "vim-one";
globalPrefix = "one_";

maintainers = [ lib.maintainers.GaetanLepage ];
Expand Down
3 changes: 1 addition & 2 deletions plugins/colorschemes/onedark.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
lib,
pkgs,
...
}:
lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "onedark";
isColorscheme = true;
originalName = "onedark.nvim";
defaultPackage = pkgs.vimPlugins.onedark-nvim;
package = "onedark-nvim";

maintainers = [ lib.maintainers.GaetanLepage ];

Expand Down
3 changes: 1 addition & 2 deletions plugins/colorschemes/oxocarbon.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
lib,
pkgs,
...
}:
lib.nixvim.vim-plugin.mkVimPlugin {
name = "oxocarbon";
isColorscheme = true;
originalName = "oxocarbon.nvim";
defaultPackage = pkgs.vimPlugins.oxocarbon-nvim;
package = "oxocarbon-nvim";

maintainers = [ lib.maintainers.GaetanLepage ];

Expand Down
2 changes: 1 addition & 1 deletion plugins/colorschemes/palette.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "palette";
isColorscheme = true;
originalName = "palette.nvim";
defaultPackage = pkgs.vimPlugins.palette-nvim;
package = "palette-nvim";

maintainers = [ lib.maintainers.GaetanLepage ];

Expand Down
3 changes: 1 addition & 2 deletions plugins/colorschemes/poimandres.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
lib,
pkgs,
...
}:
let
Expand All @@ -10,7 +9,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "poimandres";
isColorscheme = true;
originalName = "poimandres.nvim";
defaultPackage = pkgs.vimPlugins.poimandres-nvim;
package = "poimandres-nvim";

maintainers = [ lib.maintainers.GaetanLepage ];

Expand Down
2 changes: 0 additions & 2 deletions plugins/colorschemes/rose-pine.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
lib,
pkgs,
...
}:
let
Expand All @@ -9,7 +8,6 @@ in
lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "rose-pine";
isColorscheme = true;
defaultPackage = pkgs.vimPlugins.rose-pine;

maintainers = [ lib.maintainers.GaetanLepage ];

Expand Down
Loading

0 comments on commit 1fd4b6c

Please sign in to comment.