Skip to content

Commit

Permalink
plugins: remove all use of lib.nixvim.mkPackageOption
Browse files Browse the repository at this point in the history
  • Loading branch information
MattSturgeon committed Sep 5, 2024
1 parent 8467612 commit ae3a2c9
Show file tree
Hide file tree
Showing 28 changed files with 73 additions and 95 deletions.
5 changes: 2 additions & 3 deletions plugins/ai/chatgpt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ helpers.neovim-plugin.mkNeovimPlugin {
maintainers = [ maintainers.GaetanLepage ];

extraOptions = {
curlPackage = helpers.mkPackageOption {
name = "curl";
default = pkgs.curl;
curlPackage = lib.mkPackageOption pkgs "curl" {
nullable = true;
};
};

Expand Down
5 changes: 2 additions & 3 deletions plugins/completion/cmp/sources/cmp-fish.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ in
meta.maintainers = [ maintainers.GaetanLepage ];

options.plugins.cmp-fish = {
fishPackage = helpers.mkPackageOption {
name = "fish";
default = pkgs.fish;
fishPackage = lib.mkPackageOption pkgs "fish" {
nullable = true;
};
};

Expand Down
11 changes: 7 additions & 4 deletions plugins/completion/coq.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ helpers.neovim-plugin.mkNeovimPlugin {
];

extraOptions = {
# TODO: should this enable option be replaced with `nullable = true` in the package option?
installArtifacts = mkEnableOption "and install coq-artifacts";
artifactsPackage = mkOption {
type = types.package;
description = "Package to use for coq-artifacts (when enabled with installArtifacts)";
default = pkgs.vimPlugins.coq-artifacts;
artifactsPackage = mkPackageOption pkgs "coq-artifacts" {
extraDescription = "Installed when `installArtifacts` is enabled.";
default = [
"vimPlugins"
"coq-artifacts"
];
};
};

Expand Down
5 changes: 2 additions & 3 deletions plugins/filetrees/neo-tree.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ in
"nvim-web-devicons"
] { nullable = true; };

gitPackage = helpers.mkPackageOption {
name = "git";
default = pkgs.git;
gitPackage = lib.mkPackageOption pkgs "git" {
nullable = true;
};

sources =
Expand Down
5 changes: 2 additions & 3 deletions plugins/filetrees/nvim-tree.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ in
"nvim-web-devicons"
] { nullable = true; };

gitPackage = helpers.mkPackageOption {
name = "git";
default = pkgs.git;
gitPackage = lib.mkPackageOption pkgs "git" {
nullable = true;
};

disableNetrw = helpers.defaultNullOpts.mkBool false "Disable netrw";
Expand Down
6 changes: 3 additions & 3 deletions plugins/git/committia.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
helpers,
lib,
pkgs,
...
}:
Expand Down Expand Up @@ -47,9 +48,8 @@ helpers.vim-plugin.mkVimPlugin {
};

extraOptions = {
gitPackage = helpers.mkPackageOption {
name = "git";
default = pkgs.git;
gitPackage = lib.mkPackageOption pkgs "git" {
nullable = true;
};
};

Expand Down
5 changes: 2 additions & 3 deletions plugins/git/fugitive.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ helpers.vim-plugin.mkVimPlugin {

# In typical tpope fashion, this plugin has no config options
extraOptions = {
gitPackage = helpers.mkPackageOption {
name = "git";
default = pkgs.git;
gitPackage = lib.mkPackageOption pkgs "git" {
nullable = true;
};
};

Expand Down
5 changes: 2 additions & 3 deletions plugins/git/git-conflict.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ helpers.neovim-plugin.mkNeovimPlugin {
maintainers = [ maintainers.GaetanLepage ];

extraOptions = {
gitPackage = helpers.mkPackageOption {
name = "git";
default = pkgs.git;
gitPackage = lib.mkPackageOption pkgs "git" {
nullable = true;
};
};

Expand Down
5 changes: 2 additions & 3 deletions plugins/git/git-worktree.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ in

package = helpers.mkPluginPackageOption "git-worktree" pkgs.vimPlugins.git-worktree-nvim;

gitPackage = helpers.mkPackageOption {
name = "git";
default = pkgs.git;
gitPackage = lib.mkPackageOption pkgs "git" {
nullable = true;
};

enableTelescope = mkEnableOption "telescope integration";
Expand Down
7 changes: 3 additions & 4 deletions plugins/git/gitblame.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
...
}:
let
inherit (lib.nixvim) defaultNullOpts mkPackageOption;
inherit (lib.nixvim) defaultNullOpts;
types = lib.nixvim.nixvimTypes;
in
lib.nixvim.neovim-plugin.mkNeovimPlugin {
Expand Down Expand Up @@ -128,9 +128,8 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
};

extraOptions = {
gitPackage = mkPackageOption {
name = "git";
default = pkgs.git;
gitPackage = lib.mkPackageOption pkgs "git" {
nullable = true;
};
};

Expand Down
5 changes: 2 additions & 3 deletions plugins/git/gitgutter.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ in

package = helpers.mkPluginPackageOption "gitgutter" pkgs.vimPlugins.gitgutter;

gitPackage = helpers.mkPackageOption {
name = "git";
default = pkgs.git;
gitPackage = lib.mkPackageOption pkgs "git" {
nullable = true;
};

recommendedSettings = mkOption {
Expand Down
5 changes: 2 additions & 3 deletions plugins/git/gitsigns/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,8 @@ helpers.neovim-plugin.mkNeovimPlugin {
];

extraOptions = {
gitPackage = helpers.mkPackageOption {
name = "git";
default = pkgs.git;
gitPackage = lib.mkPackageOption pkgs "git" {
nullable = true;
};
};

Expand Down
10 changes: 4 additions & 6 deletions plugins/git/lazygit.nix
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,12 @@ helpers.vim-plugin.mkVimPlugin {
};

extraOptions = {
gitPackage = helpers.mkPackageOption {
name = "git";
default = pkgs.git;
gitPackage = lib.mkPackageOption pkgs "git" {
nullable = true;
};

lazygitPackage = helpers.mkPackageOption {
name = "lazygit";
default = pkgs.lazygit;
lazygitPackage = lib.mkPackageOption pkgs "lazygit" {
nullable = true;
};
};

Expand Down
5 changes: 2 additions & 3 deletions plugins/git/neogit/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ helpers.neovim-plugin.mkNeovimPlugin {
};

extraOptions = {
gitPackage = helpers.mkPackageOption {
name = "git";
default = pkgs.git;
gitPackage = lib.mkPackageOption pkgs "git" {
nullable = true;
};
};

Expand Down
6 changes: 3 additions & 3 deletions plugins/languages/godot.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ helpers.vim-plugin.mkVimPlugin {
maintainers = [ maintainers.GaetanLepage ];

extraOptions = {
godotPackage = helpers.mkPackageOption {
name = "godot";
default = pkgs.godot_4;
godotPackage = lib.mkPackageOption pkgs "godot" {
nullable = true;
default = "godot_4";
};
};

Expand Down
6 changes: 3 additions & 3 deletions plugins/languages/lean.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ in

package = helpers.mkPluginPackageOption "lean-nvim" pkgs.vimPlugins.lean-nvim;

leanPackage = helpers.mkPackageOption {
name = "lean";
default = pkgs.lean4;
leanPackage = lib.mkPackageOption pkgs "lean" {
nullable = true;
default = "lean4";
};

lsp = helpers.defaultNullOpts.mkNullable (
Expand Down
5 changes: 2 additions & 3 deletions plugins/languages/ledger.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ mkVimPlugin {
];

extraOptions = {
ledgerPackage = helpers.mkPackageOption {
name = "ledger";
default = pkgs.ledger;
ledgerPackage = lib.mkPackageOption pkgs "ledger" {
nullable = true;
};
};

Expand Down
9 changes: 2 additions & 7 deletions plugins/languages/markdown/glow.nix
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,8 @@ helpers.neovim-plugin.mkNeovimPlugin {
};

extraOptions = {
glowPackage = helpers.mkPackageOption {
description = ''
Which package to use for `glow` in your `$PATH`.
Set to `null` to disable its automatic installation.
'';
default = pkgs.glow;
defaultText = lib.literalExpression "pkgs.glow";
glowPackage = lib.mkPackageOption pkgs "glow" {
nullable = true;
};
};

Expand Down
5 changes: 2 additions & 3 deletions plugins/languages/rust/rust-tools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ in
options.plugins.rust-tools = helpers.neovim-plugin.extraOptionsOptions // {
enable = mkEnableOption "rust tools plugins";
package = helpers.mkPluginPackageOption "rust-tools" pkgs.vimPlugins.rust-tools-nvim;
serverPackage = helpers.mkPackageOption {
name = "rust-analyzer";
default = pkgs.rust-analyzer;
serverPackage = lib.mkPackageOption pkgs "rust-analyzer" {
nullable = true;
};

executor = helpers.defaultNullOpts.mkEnumFirstDefault [
Expand Down
5 changes: 2 additions & 3 deletions plugins/languages/rust/rustaceanvim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ helpers.neovim-plugin.mkNeovimPlugin {
optionsRenamedToSettings = import ./renamed-options.nix;

extraOptions = {
rustAnalyzerPackage = helpers.mkPackageOption {
name = "rust-analyzer";
default = pkgs.rust-analyzer;
rustAnalyzerPackage = lib.mkPackageOption pkgs "rust-analyzer" {
nullable = true;
};
};

Expand Down
5 changes: 2 additions & 3 deletions plugins/languages/texpresso.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ helpers.vim-plugin.mkVimPlugin {
maintainers = [ maintainers.nickhu ];

extraOptions = {
texpressoPackage = helpers.mkPackageOption {
name = "texpresso";
default = pkgs.texpresso;
texpressoPackage = lib.mkPackageOption pkgs "texpresso" {
nullable = true;
};
};

Expand Down
10 changes: 7 additions & 3 deletions plugins/languages/vimtex.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,13 @@ helpers.vim-plugin.mkVimPlugin {
};

extraOptions = {
texlivePackage = helpers.mkPackageOption {
name = "texlive";
default = pkgs.texlive.combined.scheme-medium;
texlivePackage = lib.mkPackageOption pkgs "texlive" {
nullable = true;
default = [
"texlive"
"combined"
"scheme-medium"
];
};
};

Expand Down
5 changes: 2 additions & 3 deletions plugins/pluginmanagers/lazy.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ in
plugins.lazy = {
enable = mkEnableOption "lazy.nvim";

gitPackage = helpers.mkPackageOption {
name = "git";
default = pkgs.git;
gitPackage = lib.mkPackageOption pkgs "git" {
nullable = true;
};

plugins =
Expand Down
5 changes: 2 additions & 3 deletions plugins/pluginmanagers/packer.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ in
plugins.packer = {
enable = mkEnableOption "packer.nvim";

gitPackage = helpers.mkPackageOption {
name = "git";
default = pkgs.git;
gitPackage = lib.mkPackageOption pkgs "git" {
nullable = true;
};

plugins =
Expand Down
5 changes: 2 additions & 3 deletions plugins/statuslines/lualine.nix
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ in

package = helpers.mkPluginPackageOption "lualine" pkgs.vimPlugins.lualine-nvim;

gitPackage = helpers.mkPackageOption {
name = "git";
default = pkgs.git;
gitPackage = lib.mkPackageOption pkgs "git" {
nullable = true;
};

iconsEnabled = mkOption {
Expand Down
7 changes: 3 additions & 4 deletions plugins/utils/fzf-lua.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ helpers.neovim-plugin.mkNeovimPlugin {
inherit settingsOptions settingsExample;

extraOptions = {
fzfPackage = helpers.mkPackageOption {
name = "fzf";
default = pkgs.fzf;
example = pkgs.skim;
fzfPackage = lib.mkPackageOption pkgs "fzf" {
nullable = true;
example = "pkgs.skim";
};

# TODO: deprecated 2024-08-29 remove after 24.11
Expand Down
6 changes: 2 additions & 4 deletions plugins/utils/todo-comments.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ let
defaultNullOpts
keymaps
mkNullOrOption'
mkPackageOption
transitionType
;
types = lib.nixvim.nixvimTypes;
Expand Down Expand Up @@ -405,9 +404,8 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
todoTelescope = "TodoTelescope";
};

ripgrepPackage = mkPackageOption {
name = "ripgrep";
default = pkgs.ripgrep;
ripgrepPackage = lib.mkPackageOption pkgs "ripgrep" {
nullable = true;
};
};

Expand Down
5 changes: 2 additions & 3 deletions plugins/utils/zk.nix
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ helpers.neovim-plugin.mkNeovimPlugin {
};

extraOptions = {
zkPackage = helpers.mkPackageOption {
name = "zk";
default = pkgs.zk;
zkPackage = lib.mkPackageOption pkgs "zk" {
nullable = true;
};
};
extraConfig = cfg: {
Expand Down

0 comments on commit ae3a2c9

Please sign in to comment.