Revert "helpers: add mkPackageOption + refactoring (#144)" (#149)

This reverts commit b724085447.
This commit is contained in:
Pedro Alves 2023-01-25 00:03:26 +00:00 committed by GitHub
parent b724085447
commit 2d54272177
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
58 changed files with 258 additions and 94 deletions

View file

@ -58,7 +58,7 @@
modules = nixvimModules;
};
runUpdates = pkgs.callPackage
({ pkgs, stdenv }: stdenv.mkDerivation {
({ pkgs, stdenv }: stdenv.mkDerivation {
pname = "run-updates";
version = pkgs.rust-analyzer.version;
@ -67,7 +67,7 @@
nativeBuildInputs = with pkgs; [extractRustAnalyzerPkg alejandra nixpkgs-fmt];
buildPhase = ''
extract_rust_analyzer.py editors/code/package.json |
extract_rust_analyzer.py editors/code/package.json |
alejandra --quiet |
nixpkgs-fmt > rust-analyzer-config.nix
'';

View file

@ -92,12 +92,6 @@ rec {
mkEnumFirstDefault = enum: mkEnum enum (head enum);
};
mkPackageOption = name: default: mkOption {
type = types.package;
inherit default;
description = "Plugin to use for ${name}";
};
mkPlugin = { config, lib, ... }: { name
, description
, package ? null
@ -118,7 +112,11 @@ rec {
options;
# does this evaluate package?
packageOption = if package == null then { } else {
package = mkPackageOption name package;
package = mkOption {
type = types.package;
default = package;
description = "Plugin to use for ${name}";
};
};
in
{

View file

@ -2,13 +2,16 @@
with lib;
let
cfg = config.plugins.barbar;
helpers = import ../helpers.nix { inherit lib; };
in
{
options.plugins.barbar = {
enable = mkEnableOption "barbar.nvim";
package = helpers.mkPackageOption "barbar" pkgs.vimPlugins.barbar-nvim;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.barbar-nvim;
description = "Plugin to use for barbar";
};
animations = mkOption {
type = types.nullOr types.bool;

View file

@ -34,7 +34,11 @@ in
options = {
plugins.bufferline = {
enable = mkEnableOption "bufferline";
package = helpers.mkPackageOption "bufferline" pkgs.vimPlugins.bufferline-nvim;
package = mkOption {
type = types.package;
description = "Plugin to use for bufferline";
default = pkgs.vimPlugins.bufferline-nvim;
};
numbers = mkOption {
type = types.nullOr types.lines;
description = "A lua function customizing the styling of numbers.";

View file

@ -2,7 +2,6 @@
with lib;
let
cfg = config.colorschemes.base16;
helpers = import ../helpers.nix { inherit lib; };
themes = import ./base16-list.nix;
in
{
@ -10,7 +9,11 @@ in
colorschemes.base16 = {
enable = mkEnableOption "base16";
package = helpers.mkPackageOption "base16" pkgs.vimPlugins.base16-vim;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.base16-vim;
description = "Plugin to use for base16";
};
useTruecolor = mkOption {
type = types.bool;

View file

@ -2,7 +2,6 @@
with lib;
let
cfg = config.colorschemes.gruvbox;
helpers = import ../helpers.nix { inherit lib; };
colors = types.enum [ "bg" "red" "green" "yellow" "blue" "purple" "aqua" "gray" "fg" "bg0_h" "bg0" "bg1" "bg2" "bg3" "bg4" "gray" "orange" "bg0_s" "fg0" "fg1" "fg2" "fg3" "fg4" ];
in
{
@ -10,7 +9,11 @@ in
colorschemes.gruvbox = {
enable = mkEnableOption "gruvbox";
package = helpers.mkPackageOption "gruvbox" pkgs.vimPlugins.gruvbox-nvim;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.gruvbox-nvim;
description = "Plugin to use for gruvbox";
};
italics = mkEnableOption "italics";
bold = mkEnableOption "bold";

View file

@ -2,14 +2,17 @@
with lib;
let
cfg = config.colorschemes.nord;
helpers = import ../helpers.nix { inherit lib; };
in
{
options = {
colorschemes.nord = {
enable = mkEnableOption "nord";
package = helpers.mkPackageOption "nord.vim" pkgs.vimPlugins.nord-nvim;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.nord-nvim;
description = "Plugin to use for nord.nvim";
};
contrast = mkEnableOption
"Make sidebars and popup menus like nvim-tree and telescope have a different background";

View file

@ -2,14 +2,17 @@
with lib;
let
cfg = config.colorschemes.one;
helpers = import ../helpers.nix { inherit lib; };
in
{
options = {
colorschemes.one = {
enable = mkEnableOption "vim-one";
package = helpers.mkPackageOption "one" pkgs.vimPlugins.vim-one;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.vim-one;
description = "Plugin to use for one";
};
};
};

View file

@ -8,7 +8,11 @@ in
colorschemes.onedark = {
enable = mkEnableOption "onedark";
package = helpers.mkPackageOption "one" pkgs.vimPlugins.onedark-vim;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.onedark-vim;
description = "Plugin to use for one";
};
};
};

View file

@ -9,7 +9,11 @@ in
options = {
colorschemes.tokyonight = {
enable = mkEnableOption "tokyonight";
package = helpers.mkPackageOption "tokyonight" pkgs.vimPlugins.tokyonight-nvim;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.tokyonight-nvim;
description = "Plugin to use for tokyonight";
};
style = mkOption {
type = style;
default = "storm";

View file

@ -7,7 +7,11 @@ in
options = {
plugins.copilot = {
enable = mkEnableOption "copilot";
package = helpers.mkPackageOption "copilot" pkgs.vimPlugins.copilot-vim;
package = mkOption {
type = types.package;
description = "The copilot plugin package to use";
default = pkgs.vimPlugins.copilot-vim;
};
filetypes = mkOption {
type = types.attrsOf types.bool;
description = "A dictionary mapping file types to their enabled status";

View file

@ -2,7 +2,7 @@
with lib;
let
cfg = config.plugins.coq-nvim;
helpers = import ../helpers.nix { inherit lib; };
helpers = import ../helpers.nix { lib = lib; };
plugins = import ../plugin-defs.nix { inherit pkgs; };
in
@ -11,7 +11,11 @@ in
plugins.coq-nvim = {
enable = mkEnableOption "coq-nvim";
package = helpers.mkPackageOption "coq-nvim" pkgs.vimPlugins.coq-nvim;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.coq-vim;
description = "Plugin to use for coq-nvim";
};
installArtifacts = mkEnableOption "Install coq-artifacts";

View file

@ -8,7 +8,11 @@ in
options.plugins.lspkind = {
enable = mkEnableOption "lspkind.nvim";
package = helpers.mkPackageOption "lspkind" pkgs.vimPlugins.lspkind-nvim;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.lspkind-nvim;
description = "Plugin to use for lspkind.nvim";
};
mode = mkOption {
type = with types; nullOr (enum [ "text" "text_symbol" "symbol_text" "symbol" ]);

View file

@ -1,6 +1,6 @@
{ lib, pkgs, ... }@attrs:
let
helpers = import ../../helpers.nix { inherit lib; };
helpers = import ../../helpers.nix { lib = lib; };
in with helpers; with lib;
{
mkCmpSourcePlugin = { name, extraPlugins ? [], useDefaultPackage ? true, ... }: mkPlugin attrs {

View file

@ -2,7 +2,7 @@
with lib;
let
cfg = config.plugins.nvim-cmp;
helpers = import ../../helpers.nix { inherit lib; };
helpers = import ../../helpers.nix { lib = lib; };
mkNullOrOption = helpers.mkNullOrOption;
cmpLib = import ./cmp-helpers.nix args;
# functionName should be a string
@ -17,7 +17,11 @@ in
options.plugins.nvim-cmp = {
enable = mkEnableOption "nvim-cmp";
package = helpers.mkPackageOption "nvim-cmp" pkgs.vimPlugins.nvim-cmp;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.nvim-cmp;
description = "Plugin to use for nvim-cmp";
};
performance = mkOption {
default = null;

View file

@ -1,6 +1,6 @@
{ lib, pkgs, ... }@attrs:
let
helpers = import ../helpers.nix { inherit lib; };
helpers = import ../helpers.nix { lib = lib; };
in with helpers; with lib;
mkPlugin attrs {
name = "fugitive";

View file

@ -9,7 +9,11 @@ in
plugins.gitgutter = {
enable = mkEnableOption "gitgutter";
package = helpers.mkPackageOption "gitgutter" pkgs.vimPlugins.gitgutter;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.gitgutter;
description = "Plugin to use for gitgutter";
};
recommendedSettings = mkOption {
type = types.bool;

View file

@ -37,7 +37,11 @@ in
{
options.plugins.gitsigns = {
enable = mkEnableOption "Enable gitsigns plugin";
package = helpers.mkPackageOption "gitsigns" pkgs.vimPlugins.gitsigns-nvim;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.gitsigns-nvim;
description = "Plugin to use for gitsigns";
};
signs = {
add = signOptions {
hl = "GitSignsAdd";

View file

@ -18,7 +18,11 @@ in
plugins.neogit = {
enable = mkEnableOption "neogit";
package = helpers.mkPackageOption "neogit" pkgs.vimPlugins.neogit;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.neogit;
description = "Plugin to use for neogit";
};
disableSigns = mkOption {
description = "Disable signs";

View file

@ -1 +1,2 @@
args: import ../lib/helpers.nix args

View file

@ -1,5 +1,5 @@
{ pkgs, lib, ... }@args:
with lib; with import ../helpers.nix { inherit lib; };
with lib; with import ../helpers.nix { lib = lib; };
mkPlugin args {
name = "ledger";
description = "Enable ledger language features";

View file

@ -1,6 +1,6 @@
{ lib, pkgs, ... }@attrs:
let
helpers = import ../helpers.nix { inherit lib; };
helpers = import ../helpers.nix { lib = lib; };
in with helpers; with lib;
mkPlugin attrs {
name = "nix";

View file

@ -7,7 +7,11 @@ with lib; {
options.plugins.plantuml-syntax = {
enable = mkEnableOption "plantuml syntax support";
package = helpers.mkPackageOption "plantuml-syntax" pkgs.vimPlugins.plantuml-syntax;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.plantuml-syntax;
description = "Plugin to use for plantuml-syntax";
};
setMakeprg = mkOption {
type = types.bool;

View file

@ -46,7 +46,11 @@ with lib; {
in
{
enable = mkEnableOption "rust tools plugins";
package = helpers.mkPackageOption "rust-tools" pkgs.vimPlugins.rust-tools-nvim;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.rust-tools-nvim;
description = "Package to use for rust-tools";
};
serverPackage = mkOption {
type = types.package;
default = pkgs.rust-analyzer;

View file

@ -1,14 +1,17 @@
{ pkgs
, lib
, config
, helpers
, ...
}:
with lib; {
options.plugins.treesitter-context = {
enable = mkEnableOption "nvim-treesitter-context";
package = helpers.mkPackageOption "treesitter-context" pkgs.vimPlugins.nvim-treesitter-context;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.nvim-treesitter-context;
description = "Plugin to use for nvim-treesitter-context";
};
maxLines = mkOption {
type = types.nullOr types.ints.positive;

View file

@ -3,11 +3,7 @@
, lib
, ...
}:
with lib;
let
helpers = import ../helpers.nix { inherit lib; };
in
{
with lib; {
options.plugins.treesitter-refactor =
let
disable = mkOption {
@ -21,7 +17,11 @@ in
mkEnableOption
"treesitter-refactor (requires plugins.treesitter.enable to be true)";
package = helpers.mkPackageOption "treesitter-refactor" pkgs.vimPlugins.nvim-treesitter-refactor;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.nvim-treesitter-refactor;
description = "Plugin to use for treesitter-refactor";
};
highlightDefinitions = {
inherit disable;

View file

@ -1,6 +1,6 @@
{ lib, pkgs, ... }@attrs:
let
helpers = import ../helpers.nix { inherit lib; };
helpers = import ../helpers.nix { lib = lib; };
in with helpers; with lib;
mkPlugin attrs {
name = "zig";

View file

@ -2,14 +2,18 @@
with lib;
let
cfg = config.plugins.lsp-lines;
helpers = import ../helpers.nix { inherit lib; };
helpers = import ../helpers.nix { lib = lib; };
in
{
options = {
plugins.lsp-lines = {
enable = mkEnableOption "lsp_lines.nvim";
package = helpers.mkPackageOption "lsp_lines.nvim" pkgs.vimPlugins.lsp_lines-nvim;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.lsp_lines-nvim;
description = "Plugin to use for lsp_lines.nvim";
};
currentLine = mkOption {
type = types.bool;

View file

@ -2,14 +2,18 @@
with lib;
let
cfg = config.plugins.lspsaga;
helpers = import ../helpers.nix { inherit lib; };
helpers = import ../helpers.nix { lib = lib; };
in
{
options = {
plugins.lspsaga = {
enable = mkEnableOption "lspsaga.nvim";
package = helpers.mkPackageOption "lspsaga" pkgs.vimPlugins.lspsaga-nvim;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.lspsaga-nvim;
description = "Plugin to use for lspsaga.nvim";
};
signs = {
use = mkOption {

View file

@ -10,7 +10,11 @@ with lib; {
options.plugins.nvim-lightbulb = {
enable = mkEnableOption "nvim-lightbulb, showing available code actions";
package = helpers.mkPackageOption "nvim-lightbulb" pkgs.vimPlugins.nvim-lightbulb;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.nvim-lightbulb;
description = "Plugin to use for nvim-lightbulb";
};
ignore = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
LSP client names to ignore

View file

@ -9,7 +9,11 @@ with lib;
options.plugins.trouble = {
enable = mkEnableOption "trouble.nvim";
package = helpers.mkPackageOption "trouble-nvim" pkgs.vimPlugins.trouble-nvim;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.trouble-nvim;
description = "Plugin to use for trouble-nvim";
};
position = helpers.mkNullOrOption (types.enum [ "top" "left" "right" "bottom" ]) "Position of the list";
height = helpers.mkNullOrOption types.int "Height of the trouble list when position is top or bottom";

View file

@ -2,7 +2,7 @@
with lib;
let
cfg = config.plugins.packer;
helpers = import ../helpers.nix { inherit lib; };
helpers = import ../helpers.nix { lib = lib; };
in
{
options = {

View file

@ -2,13 +2,17 @@
with lib;
let
cfg = config.plugins.luasnip;
helpers = import ../../helpers.nix { inherit lib; };
helpers = import ../../helpers.nix { lib = lib; };
in
{
options.plugins.luasnip = {
enable = mkEnableOption "Enable luasnip";
package = helpers.mkPackageOption "luasnip" pkgs.vimPlugins.luasnip;
package = mkOption {
default = pkgs.vimPlugins.luasnip;
type = types.package;
description = "Plugin to use for luasnip";
};
fromVscode = mkOption {
default = [ ];

View file

@ -16,7 +16,11 @@ in
plugins.airline = {
enable = mkEnableOption "airline";
package = helpers.mkPackageOption "airline" pkgs.vimPlugins.vim-airline;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.vim-airline;
description = "Plguin to use for airline";
};
extensions = mkOption {
default = null;

View file

@ -9,7 +9,11 @@ in
plugins.lightline = {
enable = mkEnableOption "lightline";
package = helpers.mkPackageOption "lightline" pkgs.vimPlugins.lightline-vim;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.lightline-vim;
description = "Plugin to use for lightline";
};
colorscheme = mkOption {
type = with types; nullOr str;

View file

@ -2,7 +2,7 @@
with lib;
let
cfg = config.plugins.lualine;
helpers = import ../helpers.nix { inherit lib; };
helpers = import ../helpers.nix { lib = lib; };
separators = mkOption {
type = types.nullOr (types.submodule {
options = {
@ -58,7 +58,11 @@ in
plugins.lualine = {
enable = mkEnableOption "lualine";
package = helpers.mkPackageOption "lualine" pkgs.vimPlugins.lualine-nvim;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.lualine-nvim;
description = "Plugin to use for lualine";
};
theme = mkOption {
default = config.colorscheme;

View file

@ -1,12 +1,8 @@
{ pkgs
, config
, lib
, helpers
, ...
}:
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.plugins.telescope;
helpers = (import ../helpers.nix { inherit lib; });
in
{
imports = [
@ -22,7 +18,11 @@ in
options.plugins.telescope = {
enable = mkEnableOption "telescope.nvim";
package = helpers.mkPackageOption "telescope.nvim" pkgs.vimPlugins.telescope-nvim;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.telescope-nvim;
description = "Plugin to use for telescope.nvim";
};
highlightTheme = mkOption {
type = types.nullOr types.str;

View file

@ -7,7 +7,11 @@ in
options.plugins.telescope.extensions.frecency = {
enable = mkEnableOption "frecency";
package = helpers.mkPackageOption "telescope extension frecency" pkgs.vimPlugins.telescope-frecency-nvim;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.telescope-frecency-nvim;
description = "Plugin to use for telescope frecency";
};
dbRoot = mkOption {
type = types.nullOr types.str;

View file

@ -1,4 +1,4 @@
{ pkgs, config, lib, helpers, ... }:
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.plugins.telescope.extensions.fzf-native;
@ -7,7 +7,11 @@ in
options.plugins.telescope.extensions.fzf-native = {
enable = mkEnableOption "Enable fzf-native";
package = helpers.mkPackageOption "telescope extension fzf-native" pkgs.vimPlugins.telescope-fzf-native-nvim;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.telescope-fzf-native-nvim;
description = "Plugin to use for telescope extension fzf-native";
};
fuzzy = mkOption {
type = types.nullOr types.bool;

View file

@ -1,4 +1,4 @@
{ pkgs, config, lib, helpers, ... }:
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.plugins.telescope.extensions.media_files;
@ -7,7 +7,11 @@ in
options.plugins.telescope.extensions.media_files = {
enable = mkEnableOption "Enable media_files extension for telescope";
package = helpers.mkPackageOption "telescope extension media_files" pkgs.plugins.telescope-media-files-nvim;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.telescope-media-files-nvim;
description = "Plugin to use for telescope extension media_files";
};
filetypes = mkOption {
default = null;

View file

@ -9,7 +9,11 @@ in
plugins.comment-nvim = {
enable = mkEnableOption "Enable comment-nvim";
package = helpers.mkPackageOption "comment-nvim" pkgs.vimPlugins.comment-nvim;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.comment-nvim;
description = "Plugin to use for comment-nvim";
};
padding = mkOption {
type = types.nullOr types.bool;

View file

@ -2,7 +2,6 @@
with lib;
let
cfg = config.plugins.commentary;
helpers = import ../helpers.nix { inherit lib; };
in
{
# TODO Add support for aditional filetypes. This requires autocommands!
@ -11,7 +10,11 @@ in
plugins.commentary = {
enable = mkEnableOption "commentary";
package = helpers.mkPackageOption "commentary" pkgs.vimPlugins.vim-commentary;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.vim-commentary;
description = "Plugin to use for vim-commentary";
};
};
};

View file

@ -10,7 +10,11 @@ in
plugins.dashboard = {
enable = mkEnableOption "dashboard";
package = helpers.mkPackageOption "dashboard" pkgs.vimPlugins.dashboard-nvim;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.dashboard-nvim;
description = "Plugin to use for dashboard-nvim";
};
header = mkOption {
description = "Header text";

View file

@ -9,7 +9,11 @@ in
plugins.easyescape = {
enable = mkEnableOption "Enable easyescape";
package = helpers.mkPackageOption "easyescape" pkgs.vimPlugins.vim-easyescape;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.vim-easyescape;
description = "Plugin to use for easyescape";
};
};
};
config = mkIf cfg.enable {

View file

@ -1,6 +1,6 @@
{ lib, pkgs, ... }@attrs:
let
helpers = import ../helpers.nix { inherit lib; };
helpers = import ../helpers.nix { lib = lib; };
in with helpers; with lib;
mkPlugin attrs {
name = "endwise";

View file

@ -9,7 +9,11 @@ in
plugins.floaterm = {
enable = mkEnableOption "floaterm";
package = helpers.mkPackageOption "floaterm" pkgs.vimPlugins.vim-floaterm;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.vim-floaterm;
description = "Plugin to use for floatterm";
};
shell = mkOption {
type = types.nullOr types.str;

View file

@ -1,6 +1,6 @@
{ lib, pkgs, ... }@attrs:
let
helpers = import ../helpers.nix { inherit lib; };
helpers = import ../helpers.nix { lib = lib; };
in with helpers; with lib;
mkPlugin attrs {
name = "goyo";

View file

@ -9,7 +9,11 @@ in
plugins.intellitab = {
enable = mkEnableOption "intellitab.nvim";
package = helpers.mkPackageOption "intellitab.nvim" pkgs.vimPlugins.intellitab-nvim;
package = mkOption {
type = types.package;
default = defs.intellitab-nvim;
description = "Plugin to use for intellitab.nvim";
};
};
};

View file

@ -10,7 +10,11 @@ in
options.plugins.mark-radar = {
enable = mkEnableOption "mark-radar";
package = helpers.mkPackageOption "mark-radar" pkgs.vimPlugins.mark-radar;
package = mkOption {
type = types.package;
default = defs.mark-radar;
description = "Plugin to use for mark-radar";
};
highlight_background = mkOption {
type = with types; nullOr bool;

View file

@ -2,7 +2,7 @@
with lib;
let
cfg = config.plugins.notify;
helpers = import ../helpers.nix { inherit lib; };
helpers = import ../helpers.nix { lib = lib; };
icon = mkOption {
type = types.nullOr types.str;
default = null;
@ -12,7 +12,11 @@ in
options.plugins.notify = {
enable = mkEnableOption "notify";
package = helpers.mkPackageOption "notify" pkgs.vimPlugins.nvim-notify;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.nvim-notify;
description = "Plugin to use for notify";
};
stages = mkOption {
type = types.nullOr (types.enum [ "fade_in_slide_out" "fade" "slide" "static" ]);

View file

@ -2,13 +2,17 @@
with lib;
let
cfg = config.plugins.nvim-autopairs;
helpers = import ../helpers.nix { inherit lib; };
helpers = import ../helpers.nix { lib = lib; };
in
{
options.plugins.nvim-autopairs = {
enable = mkEnableOption "nvim-autopairs";
package = helpers.mkPackageOption "nvim-autopairs" pkgs.vimPlugins.nvim-autopairs;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.nvim-autopairs;
description = "Plugin to use for nvim-autopairs";
};
pairs = mkOption {
type = types.nullOr (types.attrsOf types.str);

View file

@ -92,7 +92,11 @@ in
enable = mkEnableOption "nvim-colorizer";
package = helpers.mkPackageOption "nvim-colorizer" pkgs.vimPlugins.nvim-colorizer-lua;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.nvim-colorizer-lua;
description = "Plugin to use for vim-commentary";
};
fileTypes = mkOption {
description = "Enable and/or configure highlighting for certain filetypes";

View file

@ -2,7 +2,7 @@
with lib;
let
cfg = config.plugins.nvim-tree;
helpers = import ../helpers.nix { inherit lib; };
helpers = import ../helpers.nix { lib = lib; };
optionWarnings = import ../../lib/option-warnings.nix args;
basePluginPath = [ "plugins" "nvim-tree" ];
in
@ -21,7 +21,11 @@ in
options.plugins.nvim-tree = {
enable = mkEnableOption "nvim-tree";
package = helpers.mkPackageOption "nvim-tree" pkgs.vimPlugins.nvim-tree-lua;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.nvim-tree-lua;
description = "Plugin to use for nvim-tree";
};
disableNetrw = mkOption {
type = types.nullOr types.bool;

View file

@ -2,13 +2,17 @@
with lib;
let
cfg = config.plugins.project-nvim;
helpers = import ../helpers.nix { inherit lib pkgs; };
helpers = import ../helpers.nix { inherit lib; };
in
{
options.plugins.project-nvim = helpers.extraOptionsOptions // {
enable = mkEnableOption "project.nvim";
package = helpers.mkPackageOption "project-nvim" pkgs.vimPlugins.projecy-nvim;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.project-nvim;
description = "Plugin to use for project-nvim";
};
manualMode = mkOption {
type = types.nullOr types.bool;

View file

@ -8,7 +8,11 @@ in
options.plugins.specs = {
enable = mkEnableOption "specs-nvim";
package = helpers.mkPackageOption "specs-nvim" pkgs.vimPlugins.specs-nvim;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.specs-nvim;
description = "Plugin to use for specs-nvim";
};
show_jumps = mkOption {
type = types.bool;

View file

@ -1,6 +1,6 @@
{ pkgs, lib, ... }@args:
let
helpers = import ../helpers.nix { inherit lib; };
helpers = import ../helpers.nix { lib = lib; };
in with lib; with helpers;
mkPlugin args {
name = "startify";

View file

@ -1,6 +1,6 @@
{ lib, pkgs, ... }@attrs:
let
helpers = import ../helpers.nix { inherit lib; };
helpers = import ../helpers.nix { lib = lib; };
in with helpers; with lib;
mkPlugin attrs {
name = "surround";

View file

@ -9,7 +9,11 @@ in
plugins.undotree = {
enable = mkEnableOption "Enable undotree";
package = helpers.mkPackageOption "undotree" pkgs.vimPlugins.undotree;
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.undotree;
description = "Plugin to use for undotree";
};
windowLayout = mkOption {
type = types.nullOr types.int;