mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
misc: fix mkEnableOption descriptions
This commit is contained in:
parent
23327700e2
commit
238f0c590e
39 changed files with 525 additions and 489 deletions
|
@ -5,7 +5,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.plugins.barbar = {
|
options.plugins.barbar = {
|
||||||
enable = mkEnableOption "Enable barbar.nvim";
|
enable = mkEnableOption "barbar.nvim";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
@ -56,7 +56,8 @@ in
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
extraPlugins = with pkgs.vimPlugins; [
|
extraPlugins = with pkgs.vimPlugins; [
|
||||||
cfg.package nvim-web-devicons
|
cfg.package
|
||||||
|
nvim-web-devicons
|
||||||
];
|
];
|
||||||
|
|
||||||
# maps = genMaps cfg.keys;
|
# maps = genMaps cfg.keys;
|
||||||
|
|
|
@ -25,7 +25,7 @@ in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
plugins.bufferline = {
|
plugins.bufferline = {
|
||||||
enable = mkEnableOption "Enable bufferline";
|
enable = mkEnableOption "bufferline";
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
description = "Plugin to use for bufferline";
|
description = "Plugin to use for bufferline";
|
||||||
|
|
|
@ -7,7 +7,7 @@ in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
colorschemes.base16 = {
|
colorschemes.base16 = {
|
||||||
enable = mkEnableOption "Enable base16";
|
enable = mkEnableOption "base16";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -7,7 +7,7 @@ in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
colorschemes.gruvbox = {
|
colorschemes.gruvbox = {
|
||||||
enable = mkEnableOption "Enable gruvbox";
|
enable = mkEnableOption "gruvbox";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
@ -15,10 +15,10 @@ in
|
||||||
description = "Plugin to use for gruvbox";
|
description = "Plugin to use for gruvbox";
|
||||||
};
|
};
|
||||||
|
|
||||||
italics = mkEnableOption "Enable italics";
|
italics = mkEnableOption "italics";
|
||||||
bold = mkEnableOption "Enable bold";
|
bold = mkEnableOption "bold";
|
||||||
underline = mkEnableOption "Enable underlined text";
|
underline = mkEnableOption "underlined text";
|
||||||
undercurl = mkEnableOption "Enable undercurled text";
|
undercurl = mkEnableOption "undercurled text";
|
||||||
|
|
||||||
contrastDark = mkOption {
|
contrastDark = mkOption {
|
||||||
type = types.nullOr (types.enum [ "soft" "medium" "hard" ]);
|
type = types.nullOr (types.enum [ "soft" "medium" "hard" ]);
|
||||||
|
@ -110,9 +110,9 @@ in
|
||||||
description = "Improved warnings";
|
description = "Improved warnings";
|
||||||
};
|
};
|
||||||
|
|
||||||
transparentBg = mkEnableOption "Transparent background";
|
transparentBg = mkEnableOption "transparent background";
|
||||||
|
|
||||||
trueColor = mkEnableOption "Enable true color support";
|
trueColor = mkEnableOption "true color support";
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,7 +6,7 @@ in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
colorschemes.nord = {
|
colorschemes.nord = {
|
||||||
enable = mkEnableOption "Enable nord";
|
enable = mkEnableOption "nord";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -6,7 +6,7 @@ in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
colorschemes.one = {
|
colorschemes.one = {
|
||||||
enable = mkEnableOption "Enable vim-one";
|
enable = mkEnableOption "vim-one";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -6,7 +6,7 @@ in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
colorschemes.onedark = {
|
colorschemes.onedark = {
|
||||||
enable = mkEnableOption "Enable onedark";
|
enable = mkEnableOption "onedark";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -8,7 +8,7 @@ in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
colorschemes.tokyonight = {
|
colorschemes.tokyonight = {
|
||||||
enable = mkEnableOption "Enable tokyonight";
|
enable = mkEnableOption "tokyonight";
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
default = pkgs.vimPlugins.tokyonight-nvim;
|
default = pkgs.vimPlugins.tokyonight-nvim;
|
||||||
|
@ -24,8 +24,7 @@ in
|
||||||
default = true;
|
default = true;
|
||||||
description = "Configure the colors used when opening a :terminal in Neovim";
|
description = "Configure the colors used when opening a :terminal in Neovim";
|
||||||
};
|
};
|
||||||
transparent =
|
transparent = mkEnableOption "disable setting the background color";
|
||||||
mkEnableOption "Enable this to disable setting the background color";
|
|
||||||
styles =
|
styles =
|
||||||
let
|
let
|
||||||
mkBackgroundStyle = name: mkOption {
|
mkBackgroundStyle = name: mkOption {
|
||||||
|
|
|
@ -6,7 +6,7 @@ in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
plugins.copilot = {
|
plugins.copilot = {
|
||||||
enable = mkEnableOption "Enable copilot";
|
enable = mkEnableOption "copilot";
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
description = "The copilot plugin package to use";
|
description = "The copilot plugin package to use";
|
||||||
|
|
|
@ -9,7 +9,7 @@ in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
plugins.coq-nvim = {
|
plugins.coq-nvim = {
|
||||||
enable = mkEnableOption "Enable coq-nvim";
|
enable = mkEnableOption "coq-nvim";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -15,7 +15,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.plugins.nvim-cmp = {
|
options.plugins.nvim-cmp = {
|
||||||
enable = mkEnableOption "Enable nvim-cmp";
|
enable = mkEnableOption "nvim-cmp";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -7,7 +7,7 @@ in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
plugins.gitgutter = {
|
plugins.gitgutter = {
|
||||||
enable = mkEnableOption "Enable gitgutter";
|
enable = mkEnableOption "gitgutter";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
{
|
{ config
|
||||||
config,
|
, lib
|
||||||
lib,
|
, pkgs
|
||||||
pkgs,
|
, helpers
|
||||||
helpers,
|
, ...
|
||||||
...
|
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
signOptions = defaults:
|
signOptions = defaults:
|
||||||
|
@ -28,7 +27,7 @@ with lib; let
|
||||||
description = "Specifies the highlight group to use for the line";
|
description = "Specifies the highlight group to use for the line";
|
||||||
default = defaults.linehl;
|
default = defaults.linehl;
|
||||||
};
|
};
|
||||||
showCount = mkEnableOption "Enable showing count of hunk, e.g. number of deleted lines";
|
showCount = mkEnableOption "showing count of hunk, e.g. number of deleted lines";
|
||||||
};
|
};
|
||||||
signSetupOptions = values: {
|
signSetupOptions = values: {
|
||||||
inherit (values) hl text numhl linehl;
|
inherit (values) hl text numhl linehl;
|
||||||
|
@ -41,7 +40,8 @@ with lib; let
|
||||||
description = "Lua function definition";
|
description = "Lua function definition";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.plugins.gitsigns = {
|
options.plugins.gitsigns = {
|
||||||
enable = mkEnableOption "Enable gitsigns plugin";
|
enable = mkEnableOption "Enable gitsigns plugin";
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
|
@ -87,7 +87,8 @@ in {
|
||||||
linehl = "GitSignsAddLn";
|
linehl = "GitSignsAddLn";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
worktrees = let
|
worktrees =
|
||||||
|
let
|
||||||
worktreeModule = {
|
worktreeModule = {
|
||||||
options = {
|
options = {
|
||||||
toplevel = mkOption {
|
toplevel = mkOption {
|
||||||
|
@ -166,25 +167,26 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
numhl = mkEnableOption ''
|
numhl = mkEnableOption ''
|
||||||
Enable/disable line number highlights.
|
line number highlights.
|
||||||
|
|
||||||
When enabled the highlights defined in `signs.*.numhl` are used. If
|
When enabled the highlights defined in `signs.*.numhl` are used. If
|
||||||
the highlight group does not exist, then it is automatically defined
|
the highlight group does not exist, then it is automatically defined
|
||||||
and linked to the corresponding highlight group in `signs.*.hl`.
|
and linked to the corresponding highlight group in `signs.*.hl`.
|
||||||
'';
|
'';
|
||||||
linehl = mkEnableOption ''
|
linehl = mkEnableOption ''
|
||||||
Enable/disable line highlights.
|
line highlights.
|
||||||
|
|
||||||
When enabled the highlights defined in `signs.*.linehl` are used. If
|
When enabled the highlights defined in `signs.*.linehl` are used. If
|
||||||
the highlight group does not exist, then it is automatically defined
|
the highlight group does not exist, then it is automatically defined
|
||||||
and linked to the corresponding highlight group in `signs.*.hl`.
|
and linked to the corresponding highlight group in `signs.*.hl`.
|
||||||
'';
|
'';
|
||||||
showDeleted = mkEnableOption ''
|
showDeleted = mkEnableOption ''
|
||||||
Show the old version of hunks inline in the buffer (via virtual lines).
|
showing the old version of hunks inline in the buffer (via virtual lines).
|
||||||
|
|
||||||
Note: Virtual lines currently use the highlight `GitSignsDeleteVirtLn`.
|
Note: Virtual lines currently use the highlight `GitSignsDeleteVirtLn`.
|
||||||
'';
|
'';
|
||||||
diffOpts = let
|
diffOpts =
|
||||||
|
let
|
||||||
diffOptModule = {
|
diffOptModule = {
|
||||||
options = {
|
options = {
|
||||||
algorithm = mkOption {
|
algorithm = mkOption {
|
||||||
|
@ -352,7 +354,7 @@ in {
|
||||||
window.
|
window.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
yadm.enable = mkEnableOption "Enable YADM support";
|
yadm.enable = mkEnableOption "YADM support";
|
||||||
wordDiff = mkEnableOption ''
|
wordDiff = mkEnableOption ''
|
||||||
Highlight intra-line word differences in the buffer.
|
Highlight intra-line word differences in the buffer.
|
||||||
Requires `config.diff_opts.internal = true`.
|
Requires `config.diff_opts.internal = true`.
|
||||||
|
@ -363,14 +365,16 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
config = let
|
config =
|
||||||
|
let
|
||||||
cfg = config.plugins.gitsigns;
|
cfg = config.plugins.gitsigns;
|
||||||
in
|
in
|
||||||
mkIf cfg.enable {
|
mkIf cfg.enable {
|
||||||
extraPlugins = with pkgs.vimPlugins; [
|
extraPlugins = with pkgs.vimPlugins; [
|
||||||
cfg.package
|
cfg.package
|
||||||
];
|
];
|
||||||
extraConfigLua = let
|
extraConfigLua =
|
||||||
|
let
|
||||||
luaFnOrStrToObj = val:
|
luaFnOrStrToObj = val:
|
||||||
if builtins.isString val
|
if builtins.isString val
|
||||||
then val
|
then val
|
||||||
|
@ -395,13 +399,16 @@ in {
|
||||||
inherit (cfg.diffOpts) algorithm internal vertical linematch;
|
inherit (cfg.diffOpts) algorithm internal vertical linematch;
|
||||||
indent_heuristic = cfg.diffOpts.indentHeuristic;
|
indent_heuristic = cfg.diffOpts.indentHeuristic;
|
||||||
};
|
};
|
||||||
count_chars = let
|
count_chars =
|
||||||
|
let
|
||||||
isStrInt = s: (builtins.match "[0-9]+" s) != null;
|
isStrInt = s: (builtins.match "[0-9]+" s) != null;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
__raw =
|
__raw =
|
||||||
"{"
|
"{"
|
||||||
+ (concatStringsSep "," (
|
+ (concatStringsSep "," (
|
||||||
lib.mapAttrsToList (
|
lib.mapAttrsToList
|
||||||
|
(
|
||||||
name: value:
|
name: value:
|
||||||
if isStrInt name
|
if isStrInt name
|
||||||
then "[${name}] = ${helpers.toLuaObject value}"
|
then "[${name}] = ${helpers.toLuaObject value}"
|
||||||
|
@ -417,9 +424,11 @@ in {
|
||||||
attach_to_untracked = cfg.attachToUntracked;
|
attach_to_untracked = cfg.attachToUntracked;
|
||||||
update_debounce = cfg.updateDebounce;
|
update_debounce = cfg.updateDebounce;
|
||||||
current_line_blame = cfg.currentLineBlame;
|
current_line_blame = cfg.currentLineBlame;
|
||||||
current_line_blame_opts = let
|
current_line_blame_opts =
|
||||||
|
let
|
||||||
cfgCl = cfg.currentLineBlameOpts;
|
cfgCl = cfg.currentLineBlameOpts;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
inherit (cfgCl) delay;
|
inherit (cfgCl) delay;
|
||||||
virt_text = cfgCl.virtText;
|
virt_text = cfgCl.virtText;
|
||||||
virt_text_pos = cfgCl.virtTextPos;
|
virt_text_pos = cfgCl.virtTextPos;
|
||||||
|
@ -431,7 +440,8 @@ in {
|
||||||
word_diff = cfg.wordDiff;
|
word_diff = cfg.wordDiff;
|
||||||
debug_mode = cfg.debugMode;
|
debug_mode = cfg.debugMode;
|
||||||
};
|
};
|
||||||
in ''
|
in
|
||||||
|
''
|
||||||
require('gitsigns').setup(${helpers.toLuaObject setupOptions})
|
require('gitsigns').setup(${helpers.toLuaObject setupOptions})
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
|
@ -16,7 +16,7 @@ in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
plugins.neogit = {
|
plugins.neogit = {
|
||||||
enable = mkEnableOption "Enable neogit";
|
enable = mkEnableOption "neogit";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
{
|
{ pkgs
|
||||||
pkgs,
|
, lib
|
||||||
lib,
|
, config
|
||||||
config,
|
, ...
|
||||||
...
|
|
||||||
}:
|
}:
|
||||||
with lib; {
|
with lib; {
|
||||||
options.plugins.plantuml-syntax = {
|
options.plugins.plantuml-syntax = {
|
||||||
enable = mkEnableOption "Enable plantuml syntax support";
|
enable = mkEnableOption "plantuml syntax support";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
@ -26,7 +25,8 @@ with lib; {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = let
|
config =
|
||||||
|
let
|
||||||
cfg = config.plugins.plantuml-syntax;
|
cfg = config.plugins.plantuml-syntax;
|
||||||
in
|
in
|
||||||
mkIf cfg.enable {
|
mkIf cfg.enable {
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
{
|
{ pkgs
|
||||||
pkgs,
|
, config
|
||||||
config,
|
, lib
|
||||||
lib,
|
, helpers
|
||||||
helpers,
|
, ...
|
||||||
...
|
|
||||||
}:
|
}:
|
||||||
with lib; {
|
with lib; {
|
||||||
options.plugins.rust-tools = let
|
options.plugins.rust-tools =
|
||||||
mkNullableOptionWithDefault = {
|
let
|
||||||
type,
|
mkNullableOptionWithDefault =
|
||||||
description,
|
{ type
|
||||||
default,
|
, description
|
||||||
|
, default
|
||||||
|
,
|
||||||
}:
|
}:
|
||||||
mkOption {
|
mkOption {
|
||||||
type = types.nullOr type;
|
type = types.nullOr type;
|
||||||
|
@ -42,8 +43,9 @@ with lib; {
|
||||||
type = types.int;
|
type = types.int;
|
||||||
default = toString default;
|
default = toString default;
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
enable = mkEnableOption "Enable rust tools plugins";
|
{
|
||||||
|
enable = mkEnableOption "rust tools plugins";
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
default = pkgs.vimPlugins.rust-tools-nvim;
|
default = pkgs.vimPlugins.rust-tools-nvim;
|
||||||
|
@ -152,13 +154,15 @@ with lib; {
|
||||||
}
|
}
|
||||||
// (import ../nvim-lsp/rust-analyzer-config.nix lib);
|
// (import ../nvim-lsp/rust-analyzer-config.nix lib);
|
||||||
};
|
};
|
||||||
config = let
|
config =
|
||||||
|
let
|
||||||
cfg = config.plugins.rust-tools;
|
cfg = config.plugins.rust-tools;
|
||||||
in
|
in
|
||||||
mkIf cfg.enable {
|
mkIf cfg.enable {
|
||||||
extraPlugins = with pkgs.vimPlugins; [ nvim-lspconfig cfg.package ];
|
extraPlugins = with pkgs.vimPlugins; [ nvim-lspconfig cfg.package ];
|
||||||
|
|
||||||
plugins.lsp.postConfig = let
|
plugins.lsp.postConfig =
|
||||||
|
let
|
||||||
setupOptions = {
|
setupOptions = {
|
||||||
tools = {
|
tools = {
|
||||||
executor =
|
executor =
|
||||||
|
@ -172,9 +176,11 @@ with lib; {
|
||||||
else null;
|
else null;
|
||||||
|
|
||||||
reload_workspace_from_cargo_toml = cfg.reloadWorkspaceFromCargoToml;
|
reload_workspace_from_cargo_toml = cfg.reloadWorkspaceFromCargoToml;
|
||||||
inlay_hints = let
|
inlay_hints =
|
||||||
|
let
|
||||||
cfgIH = cfg.inlayHints;
|
cfgIH = cfg.inlayHints;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
auto = cfgIH.auto;
|
auto = cfgIH.auto;
|
||||||
only_current_line = cfgIH.onlyCurrentLine;
|
only_current_line = cfgIH.onlyCurrentLine;
|
||||||
show_parameter_hints = cfgIH.showParameterHints;
|
show_parameter_hints = cfgIH.showParameterHints;
|
||||||
|
@ -187,18 +193,22 @@ with lib; {
|
||||||
highlight = cfgIH.highlight;
|
highlight = cfgIH.highlight;
|
||||||
};
|
};
|
||||||
|
|
||||||
hover_actions = let
|
hover_actions =
|
||||||
|
let
|
||||||
cfgHA = cfg.hoverActions;
|
cfgHA = cfg.hoverActions;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
border = cfgHA.border;
|
border = cfgHA.border;
|
||||||
max_width = cfgHA.maxWidth;
|
max_width = cfgHA.maxWidth;
|
||||||
max_height = cfgHA.maxHeight;
|
max_height = cfgHA.maxHeight;
|
||||||
auto_focus = cfgHA.autoFocus;
|
auto_focus = cfgHA.autoFocus;
|
||||||
};
|
};
|
||||||
|
|
||||||
crate_graph = let
|
crate_graph =
|
||||||
|
let
|
||||||
cfgCG = cfg.crateGraph;
|
cfgCG = cfg.crateGraph;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
backend = cfgCG.backend;
|
backend = cfgCG.backend;
|
||||||
output = cfgCG.output;
|
output = cfgCG.output;
|
||||||
full = cfgCG.full;
|
full = cfgCG.full;
|
||||||
|
@ -211,7 +221,8 @@ with lib; {
|
||||||
on_attach = { __raw = "__lspOnAttach"; };
|
on_attach = { __raw = "__lspOnAttach"; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in ''
|
in
|
||||||
|
''
|
||||||
require('rust-tools').setup(${helpers.toLuaObject setupOptions})
|
require('rust-tools').setup(${helpers.toLuaObject setupOptions})
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
}:
|
}:
|
||||||
with lib; {
|
with lib; {
|
||||||
options.plugins.treesitter-context = {
|
options.plugins.treesitter-context = {
|
||||||
enable = mkEnableOption "Enable nvim-treesitter-context";
|
enable = mkEnableOption "nvim-treesitter-context";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -15,7 +15,7 @@ with lib; {
|
||||||
{
|
{
|
||||||
enable =
|
enable =
|
||||||
mkEnableOption
|
mkEnableOption
|
||||||
"Enable treesitter-refactor (requires plugins.treesitter.enable to be true)";
|
"treesitter-refactor (requires plugins.treesitter.enable to be true)";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
@ -39,7 +39,7 @@ with lib; {
|
||||||
};
|
};
|
||||||
highlightCurrentScope = {
|
highlightCurrentScope = {
|
||||||
inherit disable;
|
inherit disable;
|
||||||
enable = mkEnableOption "Highlights the block from the current scope where the cursor is.";
|
enable = mkEnableOption "highlights the block from the current scope where the cursor is.";
|
||||||
};
|
};
|
||||||
smartRename = {
|
smartRename = {
|
||||||
inherit disable;
|
inherit disable;
|
||||||
|
|
|
@ -7,7 +7,7 @@ in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
plugins.treesitter = {
|
plugins.treesitter = {
|
||||||
enable = mkEnableOption "Enable tree-sitter syntax highlighting";
|
enable = mkEnableOption "tree-sitter syntax highlighting";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
@ -66,7 +66,7 @@ in
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
enable = mkEnableOption "Incremental selection based on the named nodes from the grammar";
|
enable = mkEnableOption "incremental selection based on the named nodes from the grammar";
|
||||||
keymaps = {
|
keymaps = {
|
||||||
initSelection = keymap "gnn";
|
initSelection = keymap "gnn";
|
||||||
nodeIncremental = keymap "grn";
|
nodeIncremental = keymap "grn";
|
||||||
|
@ -75,9 +75,9 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
indent = mkEnableOption "Enable tree-sitter based indentation";
|
indent = mkEnableOption "tree-sitter based indentation";
|
||||||
|
|
||||||
folding = mkEnableOption "Enable tree-sitter based folding";
|
folding = mkEnableOption "tree-sitter based folding";
|
||||||
|
|
||||||
grammarPackages = mkOption {
|
grammarPackages = mkOption {
|
||||||
type = with types; listOf package;
|
type = with types; listOf package;
|
||||||
|
|
|
@ -10,7 +10,7 @@ in
|
||||||
];
|
];
|
||||||
|
|
||||||
options.plugins.null-ls = {
|
options.plugins.null-ls = {
|
||||||
enable = mkEnableOption "Enable null-ls";
|
enable = mkEnableOption "null-ls";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
mkServer =
|
mkServer =
|
||||||
{ name
|
{ name
|
||||||
, sourceType
|
, sourceType
|
||||||
, description ? "Enable ${name} source, for null-ls."
|
, description ? "${name} source, for null-ls."
|
||||||
, package ? null
|
, package ? null
|
||||||
, extraPackages ? [ ]
|
, extraPackages ? [ ]
|
||||||
, ...
|
, ...
|
||||||
|
|
|
@ -11,7 +11,7 @@ in
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
plugins.lsp = {
|
plugins.lsp = {
|
||||||
enable = mkEnableOption "Enable neovim's built-in LSP";
|
enable = mkEnableOption "neovim's built-in LSP";
|
||||||
|
|
||||||
enabledServers = mkOption {
|
enabledServers = mkOption {
|
||||||
type = with types; listOf (oneOf [
|
type = with types; listOf (oneOf [
|
||||||
|
|
|
@ -7,7 +7,7 @@ in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
plugins.lspsaga = {
|
plugins.lspsaga = {
|
||||||
enable = mkEnableOption "Enable lspsava.nvim";
|
enable = mkEnableOption "lspsaga.nvim";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
@ -111,13 +111,15 @@ in
|
||||||
description = "Maximum finder preview lines";
|
description = "Maximum finder preview lines";
|
||||||
};
|
};
|
||||||
|
|
||||||
keys = let
|
keys =
|
||||||
|
let
|
||||||
defaultKeyOpt = desc: mkOption {
|
defaultKeyOpt = desc: mkOption {
|
||||||
description = desc;
|
description = desc;
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
default = null;
|
default = null;
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
finderAction = {
|
finderAction = {
|
||||||
open = defaultKeyOpt "Open from finder";
|
open = defaultKeyOpt "Open from finder";
|
||||||
vsplit = defaultKeyOpt "Vertical split in finder";
|
vsplit = defaultKeyOpt "Vertical split in finder";
|
||||||
|
@ -147,7 +149,8 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = let
|
config =
|
||||||
|
let
|
||||||
notDefault = default: opt: if (opt != default) then opt else null;
|
notDefault = default: opt: if (opt != default) then opt else null;
|
||||||
notEmpty = opt: if ((filterAttrs (_: v: v != null) opt) != { }) then opt else null;
|
notEmpty = opt: if ((filterAttrs (_: v: v != null) opt) != { }) then opt else null;
|
||||||
notNull = opt: opt;
|
notNull = opt: opt;
|
||||||
|
@ -175,14 +178,18 @@ in
|
||||||
|
|
||||||
rename_prompt_prefix = notNull cfg.renamePromptPrefix;
|
rename_prompt_prefix = notNull cfg.renamePromptPrefix;
|
||||||
|
|
||||||
border_style = let
|
border_style =
|
||||||
borderStyle = if cfg.borderStyle == "thin" then 1
|
let
|
||||||
|
borderStyle =
|
||||||
|
if cfg.borderStyle == "thin" then 1
|
||||||
else if cfg.borderStyle == "rounded" then 2
|
else if cfg.borderStyle == "rounded" then 2
|
||||||
else if cfg.borderStyle == "thick" then 3
|
else if cfg.borderStyle == "thick" then 3
|
||||||
else null;
|
else null;
|
||||||
in borderStyle;
|
in
|
||||||
|
borderStyle;
|
||||||
|
|
||||||
finder_action_keys = let
|
finder_action_keys =
|
||||||
|
let
|
||||||
keys = {
|
keys = {
|
||||||
open = notNull cfg.keys.finderAction.open;
|
open = notNull cfg.keys.finderAction.open;
|
||||||
vsplit = notNull cfg.keys.finderAction.vsplit;
|
vsplit = notNull cfg.keys.finderAction.vsplit;
|
||||||
|
@ -191,16 +198,20 @@ in
|
||||||
scroll_down = notNull cfg.keys.finderAction.scrollDown;
|
scroll_down = notNull cfg.keys.finderAction.scrollDown;
|
||||||
scroll_up = notNull cfg.keys.finderAction.scrollUp;
|
scroll_up = notNull cfg.keys.finderAction.scrollUp;
|
||||||
};
|
};
|
||||||
in notEmpty keys;
|
in
|
||||||
|
notEmpty keys;
|
||||||
|
|
||||||
code_action_keys = let
|
code_action_keys =
|
||||||
|
let
|
||||||
keys = {
|
keys = {
|
||||||
quit = notNull cfg.keys.codeAction.quit;
|
quit = notNull cfg.keys.codeAction.quit;
|
||||||
exec = notNull cfg.keys.codeAction.exec;
|
exec = notNull cfg.keys.codeAction.exec;
|
||||||
};
|
};
|
||||||
in notEmpty keys;
|
in
|
||||||
|
notEmpty keys;
|
||||||
};
|
};
|
||||||
in mkIf cfg.enable {
|
in
|
||||||
|
mkIf cfg.enable {
|
||||||
|
|
||||||
extraPlugins = [ cfg.package ];
|
extraPlugins = [ cfg.package ];
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
plugins.packer = {
|
plugins.packer = {
|
||||||
enable = mkEnableOption "Enable packer.nvim";
|
enable = mkEnableOption "packer.nvim";
|
||||||
|
|
||||||
plugins = mkOption {
|
plugins = mkOption {
|
||||||
type = types.listOf (types.oneOf [
|
type = types.listOf (types.oneOf [
|
||||||
|
|
|
@ -14,7 +14,7 @@ in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
plugins.airline = {
|
plugins.airline = {
|
||||||
enable = mkEnableOption "Enable airline";
|
enable = mkEnableOption "airline";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -7,7 +7,7 @@ in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
plugins.lightline = {
|
plugins.lightline = {
|
||||||
enable = mkEnableOption "Enable lightline";
|
enable = mkEnableOption "lightline";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -56,7 +56,7 @@ in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
plugins.lualine = {
|
plugins.lualine = {
|
||||||
enable = mkEnableOption "Enable lualine";
|
enable = mkEnableOption "lualine";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -16,7 +16,7 @@ in
|
||||||
# TODO:add support for aditional filetypes. This requires autocommands!
|
# TODO:add support for aditional filetypes. This requires autocommands!
|
||||||
|
|
||||||
options.plugins.telescope = {
|
options.plugins.telescope = {
|
||||||
enable = mkEnableOption "Enable telescope.nvim";
|
enable = mkEnableOption "telescope.nvim";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
@ -68,12 +68,14 @@ in
|
||||||
let $BAT_THEME = '${cfg.highlightTheme}'
|
let $BAT_THEME = '${cfg.highlightTheme}'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
extraConfigLua = let
|
extraConfigLua =
|
||||||
|
let
|
||||||
options = {
|
options = {
|
||||||
extensions = cfg.extensionConfig;
|
extensions = cfg.extensionConfig;
|
||||||
defaults = cfg.defaults;
|
defaults = cfg.defaults;
|
||||||
} // cfg.extraOptions;
|
} // cfg.extraOptions;
|
||||||
in ''
|
in
|
||||||
|
''
|
||||||
do
|
do
|
||||||
local __telescopeExtensions = ${helpers.toLuaObject cfg.enabledExtensions}
|
local __telescopeExtensions = ${helpers.toLuaObject cfg.enabledExtensions}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.plugins.telescope.extensions.frecency = {
|
options.plugins.telescope.extensions.frecency = {
|
||||||
enable = mkEnableOption "Enable frecency";
|
enable = mkEnableOption "frecency";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
@ -50,7 +50,8 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = let
|
config =
|
||||||
|
let
|
||||||
configuration = {
|
configuration = {
|
||||||
db_root = cfg.dbRoot;
|
db_root = cfg.dbRoot;
|
||||||
default_workspace = cfg.defaultWorkspace;
|
default_workspace = cfg.defaultWorkspace;
|
||||||
|
@ -60,7 +61,8 @@ in
|
||||||
show_unindexed = cfg.showUnindexed;
|
show_unindexed = cfg.showUnindexed;
|
||||||
devicons_disabled = cfg.deviconsDisabled;
|
devicons_disabled = cfg.deviconsDisabled;
|
||||||
};
|
};
|
||||||
in mkIf cfg.enable {
|
in
|
||||||
|
mkIf cfg.enable {
|
||||||
extraPackages = [ pkgs.sqlite ];
|
extraPackages = [ pkgs.sqlite ];
|
||||||
extraPlugins = with pkgs.vimPlugins; [
|
extraPlugins = with pkgs.vimPlugins; [
|
||||||
cfg.package
|
cfg.package
|
||||||
|
|
|
@ -5,7 +5,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.plugins.telescope.extensions.project-nvim = {
|
options.plugins.telescope.extensions.project-nvim = {
|
||||||
enable = mkEnableOption "Enable project-nvim telescope extension";
|
enable = mkEnableOption "project-nvim telescope extension";
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ in
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
plugins.commentary = {
|
plugins.commentary = {
|
||||||
enable = mkEnableOption "Enable commentary";
|
enable = mkEnableOption "commentary";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -8,7 +8,7 @@ in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
plugins.dashboard = {
|
plugins.dashboard = {
|
||||||
enable = mkEnableOption "Enable dashboard";
|
enable = mkEnableOption "dashboard";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -7,7 +7,7 @@ in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
plugins.floaterm = {
|
plugins.floaterm = {
|
||||||
enable = mkEnableOption "Enable floaterm";
|
enable = mkEnableOption "floaterm";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -8,7 +8,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.plugins.mark-radar = {
|
options.plugins.mark-radar = {
|
||||||
enable = mkEnableOption "Enable mark-radar";
|
enable = mkEnableOption "mark-radar";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -10,7 +10,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.plugins.notify = {
|
options.plugins.notify = {
|
||||||
enable = mkEnableOption "Enable notify";
|
enable = mkEnableOption "notify";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -6,7 +6,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.plugins.nvim-autopairs = {
|
options.plugins.nvim-autopairs = {
|
||||||
enable = mkEnableOption "Enable nvim-autopairs";
|
enable = mkEnableOption "nvim-autopairs";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -6,7 +6,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.plugins.nvim-tree = {
|
options.plugins.nvim-tree = {
|
||||||
enable = mkEnableOption "Enable nvim-tree";
|
enable = mkEnableOption "nvim-tree";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -6,7 +6,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.plugins.project-nvim = helpers.extraOptionsOptions // {
|
options.plugins.project-nvim = helpers.extraOptionsOptions // {
|
||||||
enable = mkEnableOption "Enable project.nvim";
|
enable = mkEnableOption "project.nvim";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -6,7 +6,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.plugins.specs = {
|
options.plugins.specs = {
|
||||||
enable = mkEnableOption "Enable specs-nvim";
|
enable = mkEnableOption "specs-nvim";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue