diff --git a/flake.nix b/flake.nix index 98783ffe..6e4ae51d 100644 --- a/flake.nix +++ b/flake.nix @@ -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 ''; diff --git a/lib/helpers.nix b/lib/helpers.nix index 05347234..a71a3acf 100644 --- a/lib/helpers.nix +++ b/lib/helpers.nix @@ -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 { diff --git a/plugins/bufferlines/barbar.nix b/plugins/bufferlines/barbar.nix index 828c480f..7d7e7e48 100644 --- a/plugins/bufferlines/barbar.nix +++ b/plugins/bufferlines/barbar.nix @@ -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; diff --git a/plugins/bufferlines/bufferline.nix b/plugins/bufferlines/bufferline.nix index 090a553c..e8371197 100644 --- a/plugins/bufferlines/bufferline.nix +++ b/plugins/bufferlines/bufferline.nix @@ -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."; diff --git a/plugins/colorschemes/base16.nix b/plugins/colorschemes/base16.nix index 1a61c4d5..d7866c11 100644 --- a/plugins/colorschemes/base16.nix +++ b/plugins/colorschemes/base16.nix @@ -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; diff --git a/plugins/colorschemes/gruvbox.nix b/plugins/colorschemes/gruvbox.nix index dcc3b590..cc591b12 100644 --- a/plugins/colorschemes/gruvbox.nix +++ b/plugins/colorschemes/gruvbox.nix @@ -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"; diff --git a/plugins/colorschemes/nord.nix b/plugins/colorschemes/nord.nix index cc464f72..68926bbd 100644 --- a/plugins/colorschemes/nord.nix +++ b/plugins/colorschemes/nord.nix @@ -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"; diff --git a/plugins/colorschemes/one.nix b/plugins/colorschemes/one.nix index d4432570..7ef50559 100644 --- a/plugins/colorschemes/one.nix +++ b/plugins/colorschemes/one.nix @@ -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"; + }; }; }; diff --git a/plugins/colorschemes/onedark.nix b/plugins/colorschemes/onedark.nix index 2633282c..e12ed110 100644 --- a/plugins/colorschemes/onedark.nix +++ b/plugins/colorschemes/onedark.nix @@ -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"; + }; }; }; diff --git a/plugins/colorschemes/tokyonight.nix b/plugins/colorschemes/tokyonight.nix index fba4069f..1cf99d9c 100644 --- a/plugins/colorschemes/tokyonight.nix +++ b/plugins/colorschemes/tokyonight.nix @@ -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"; diff --git a/plugins/completion/copilot.nix b/plugins/completion/copilot.nix index 69b4ab4e..8a30cb51 100644 --- a/plugins/completion/copilot.nix +++ b/plugins/completion/copilot.nix @@ -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"; diff --git a/plugins/completion/coq.nix b/plugins/completion/coq.nix index 05c01e4e..82be1f98 100644 --- a/plugins/completion/coq.nix +++ b/plugins/completion/coq.nix @@ -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"; diff --git a/plugins/completion/lspkind.nix b/plugins/completion/lspkind.nix index e03293c0..3dc4f8fe 100644 --- a/plugins/completion/lspkind.nix +++ b/plugins/completion/lspkind.nix @@ -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" ]); diff --git a/plugins/completion/nvim-cmp/cmp-helpers.nix b/plugins/completion/nvim-cmp/cmp-helpers.nix index 72cc4075..ca39a57f 100644 --- a/plugins/completion/nvim-cmp/cmp-helpers.nix +++ b/plugins/completion/nvim-cmp/cmp-helpers.nix @@ -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 { diff --git a/plugins/completion/nvim-cmp/default.nix b/plugins/completion/nvim-cmp/default.nix index 8812a62e..39b0dd48 100644 --- a/plugins/completion/nvim-cmp/default.nix +++ b/plugins/completion/nvim-cmp/default.nix @@ -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; diff --git a/plugins/git/fugitive.nix b/plugins/git/fugitive.nix index d3baeb02..729a7eb2 100644 --- a/plugins/git/fugitive.nix +++ b/plugins/git/fugitive.nix @@ -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"; diff --git a/plugins/git/gitgutter.nix b/plugins/git/gitgutter.nix index 81d9ac79..e860230c 100644 --- a/plugins/git/gitgutter.nix +++ b/plugins/git/gitgutter.nix @@ -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; diff --git a/plugins/git/gitsigns.nix b/plugins/git/gitsigns.nix index cff50d9b..c9447a93 100644 --- a/plugins/git/gitsigns.nix +++ b/plugins/git/gitsigns.nix @@ -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"; diff --git a/plugins/git/neogit.nix b/plugins/git/neogit.nix index 3fcccc13..af69c42d 100644 --- a/plugins/git/neogit.nix +++ b/plugins/git/neogit.nix @@ -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"; diff --git a/plugins/helpers.nix b/plugins/helpers.nix index 9d501be8..a6d36262 100644 --- a/plugins/helpers.nix +++ b/plugins/helpers.nix @@ -1 +1,2 @@ args: import ../lib/helpers.nix args + diff --git a/plugins/languages/ledger.nix b/plugins/languages/ledger.nix index 49a9dda7..d8aa1b07 100644 --- a/plugins/languages/ledger.nix +++ b/plugins/languages/ledger.nix @@ -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"; diff --git a/plugins/languages/nix.nix b/plugins/languages/nix.nix index d314e330..bc5b9340 100644 --- a/plugins/languages/nix.nix +++ b/plugins/languages/nix.nix @@ -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"; diff --git a/plugins/languages/plantuml-syntax.nix b/plugins/languages/plantuml-syntax.nix index ea773163..8083702d 100644 --- a/plugins/languages/plantuml-syntax.nix +++ b/plugins/languages/plantuml-syntax.nix @@ -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; diff --git a/plugins/languages/rust.nix b/plugins/languages/rust.nix index df11abbf..24c49c5a 100644 --- a/plugins/languages/rust.nix +++ b/plugins/languages/rust.nix @@ -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; diff --git a/plugins/languages/treesitter-context.nix b/plugins/languages/treesitter-context.nix index fa41f168..5c1f48e5 100644 --- a/plugins/languages/treesitter-context.nix +++ b/plugins/languages/treesitter-context.nix @@ -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; diff --git a/plugins/languages/treesitter-refactor.nix b/plugins/languages/treesitter-refactor.nix index a490016d..d0791808 100644 --- a/plugins/languages/treesitter-refactor.nix +++ b/plugins/languages/treesitter-refactor.nix @@ -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; diff --git a/plugins/languages/zig.nix b/plugins/languages/zig.nix index 78958596..e6353cbf 100644 --- a/plugins/languages/zig.nix +++ b/plugins/languages/zig.nix @@ -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"; diff --git a/plugins/nvim-lsp/lsp-lines.nix b/plugins/nvim-lsp/lsp-lines.nix index 19ef3838..df06930d 100644 --- a/plugins/nvim-lsp/lsp-lines.nix +++ b/plugins/nvim-lsp/lsp-lines.nix @@ -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; diff --git a/plugins/nvim-lsp/lspsaga.nix b/plugins/nvim-lsp/lspsaga.nix index 4f786230..f5bf6ecf 100644 --- a/plugins/nvim-lsp/lspsaga.nix +++ b/plugins/nvim-lsp/lspsaga.nix @@ -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 { diff --git a/plugins/nvim-lsp/nvim-lightbulb.nix b/plugins/nvim-lsp/nvim-lightbulb.nix index 2426b840..67ec2d08 100644 --- a/plugins/nvim-lsp/nvim-lightbulb.nix +++ b/plugins/nvim-lsp/nvim-lightbulb.nix @@ -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 diff --git a/plugins/nvim-lsp/trouble.nix b/plugins/nvim-lsp/trouble.nix index f323f606..d416a0c4 100644 --- a/plugins/nvim-lsp/trouble.nix +++ b/plugins/nvim-lsp/trouble.nix @@ -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"; diff --git a/plugins/pluginmanagers/packer.nix b/plugins/pluginmanagers/packer.nix index 7f05955a..e5f96703 100644 --- a/plugins/pluginmanagers/packer.nix +++ b/plugins/pluginmanagers/packer.nix @@ -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 = { diff --git a/plugins/snippets/luasnip/default.nix b/plugins/snippets/luasnip/default.nix index 24e278d2..c8485d0a 100644 --- a/plugins/snippets/luasnip/default.nix +++ b/plugins/snippets/luasnip/default.nix @@ -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 = [ ]; diff --git a/plugins/statuslines/airline.nix b/plugins/statuslines/airline.nix index 6ff4ff87..56f491d9 100644 --- a/plugins/statuslines/airline.nix +++ b/plugins/statuslines/airline.nix @@ -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; diff --git a/plugins/statuslines/lightline.nix b/plugins/statuslines/lightline.nix index 290e5abc..5b53ee1c 100644 --- a/plugins/statuslines/lightline.nix +++ b/plugins/statuslines/lightline.nix @@ -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; diff --git a/plugins/statuslines/lualine.nix b/plugins/statuslines/lualine.nix index 016c34fb..67f23b8d 100644 --- a/plugins/statuslines/lualine.nix +++ b/plugins/statuslines/lualine.nix @@ -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; diff --git a/plugins/telescope/default.nix b/plugins/telescope/default.nix index fe364a63..e774fe3b 100644 --- a/plugins/telescope/default.nix +++ b/plugins/telescope/default.nix @@ -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; diff --git a/plugins/telescope/frecency.nix b/plugins/telescope/frecency.nix index a9dfa865..8d871730 100644 --- a/plugins/telescope/frecency.nix +++ b/plugins/telescope/frecency.nix @@ -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; diff --git a/plugins/telescope/fzf-native.nix b/plugins/telescope/fzf-native.nix index ea993451..525651dc 100644 --- a/plugins/telescope/fzf-native.nix +++ b/plugins/telescope/fzf-native.nix @@ -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; diff --git a/plugins/telescope/media-files.nix b/plugins/telescope/media-files.nix index d70d38ab..df2025d4 100644 --- a/plugins/telescope/media-files.nix +++ b/plugins/telescope/media-files.nix @@ -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; diff --git a/plugins/utils/comment-nvim.nix b/plugins/utils/comment-nvim.nix index 471f0c7b..f7c823ed 100644 --- a/plugins/utils/comment-nvim.nix +++ b/plugins/utils/comment-nvim.nix @@ -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; diff --git a/plugins/utils/commentary.nix b/plugins/utils/commentary.nix index 885d81f2..cfd428c5 100644 --- a/plugins/utils/commentary.nix +++ b/plugins/utils/commentary.nix @@ -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"; + }; }; }; diff --git a/plugins/utils/dashboard.nix b/plugins/utils/dashboard.nix index e47ec62e..311d7b93 100644 --- a/plugins/utils/dashboard.nix +++ b/plugins/utils/dashboard.nix @@ -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"; diff --git a/plugins/utils/easyescape.nix b/plugins/utils/easyescape.nix index 990727de..3c75ebd5 100644 --- a/plugins/utils/easyescape.nix +++ b/plugins/utils/easyescape.nix @@ -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 { diff --git a/plugins/utils/endwise.nix b/plugins/utils/endwise.nix index e584629d..1c5beb9b 100644 --- a/plugins/utils/endwise.nix +++ b/plugins/utils/endwise.nix @@ -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"; diff --git a/plugins/utils/floaterm.nix b/plugins/utils/floaterm.nix index 3a098676..cc340ce6 100644 --- a/plugins/utils/floaterm.nix +++ b/plugins/utils/floaterm.nix @@ -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; diff --git a/plugins/utils/goyo.nix b/plugins/utils/goyo.nix index ac23ab23..5c0406f2 100644 --- a/plugins/utils/goyo.nix +++ b/plugins/utils/goyo.nix @@ -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"; diff --git a/plugins/utils/intellitab.nix b/plugins/utils/intellitab.nix index 183c16cb..706f9bf8 100644 --- a/plugins/utils/intellitab.nix +++ b/plugins/utils/intellitab.nix @@ -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"; + }; }; }; diff --git a/plugins/utils/mark-radar.nix b/plugins/utils/mark-radar.nix index ff43924e..deb55ccf 100644 --- a/plugins/utils/mark-radar.nix +++ b/plugins/utils/mark-radar.nix @@ -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; diff --git a/plugins/utils/notify.nix b/plugins/utils/notify.nix index 73e7cc64..9bd1a416 100644 --- a/plugins/utils/notify.nix +++ b/plugins/utils/notify.nix @@ -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" ]); diff --git a/plugins/utils/nvim-autopairs.nix b/plugins/utils/nvim-autopairs.nix index c392c57d..ec330ea1 100644 --- a/plugins/utils/nvim-autopairs.nix +++ b/plugins/utils/nvim-autopairs.nix @@ -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); diff --git a/plugins/utils/nvim-colorizer.nix b/plugins/utils/nvim-colorizer.nix index 56e5d012..8c4eaf30 100644 --- a/plugins/utils/nvim-colorizer.nix +++ b/plugins/utils/nvim-colorizer.nix @@ -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"; diff --git a/plugins/utils/nvim-tree.nix b/plugins/utils/nvim-tree.nix index b4fff5a1..bf4fb9ac 100644 --- a/plugins/utils/nvim-tree.nix +++ b/plugins/utils/nvim-tree.nix @@ -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; diff --git a/plugins/utils/project-nvim.nix b/plugins/utils/project-nvim.nix index 9eaf4971..14651295 100644 --- a/plugins/utils/project-nvim.nix +++ b/plugins/utils/project-nvim.nix @@ -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; diff --git a/plugins/utils/specs.nix b/plugins/utils/specs.nix index cd42b8dc..a8808fa9 100644 --- a/plugins/utils/specs.nix +++ b/plugins/utils/specs.nix @@ -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; diff --git a/plugins/utils/startify.nix b/plugins/utils/startify.nix index cac64076..e4d371f6 100644 --- a/plugins/utils/startify.nix +++ b/plugins/utils/startify.nix @@ -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"; diff --git a/plugins/utils/surround.nix b/plugins/utils/surround.nix index 2580c8bc..bf2b7d63 100644 --- a/plugins/utils/surround.nix +++ b/plugins/utils/surround.nix @@ -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"; diff --git a/plugins/utils/undotree.nix b/plugins/utils/undotree.nix index 223b5a5f..5c74cc4b 100644 --- a/plugins/utils/undotree.nix +++ b/plugins/utils/undotree.nix @@ -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;