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
|
||||
{
|
||||
options.plugins.barbar = {
|
||||
enable = mkEnableOption "Enable barbar.nvim";
|
||||
enable = mkEnableOption "barbar.nvim";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
@ -32,13 +32,13 @@ in
|
|||
};
|
||||
|
||||
icons = mkOption {
|
||||
type = with types; nullOr (oneOf [bool (enum ["numbers both"])]);
|
||||
type = with types; nullOr (oneOf [ bool (enum [ "numbers both" ]) ]);
|
||||
default = null;
|
||||
description = "Enable/disable icons";
|
||||
};
|
||||
|
||||
iconCustomColors = mkOption {
|
||||
type = with types; nullOr (oneOf [bool str]);
|
||||
type = with types; nullOr (oneOf [ bool str ]);
|
||||
default = null;
|
||||
description = "Sets the icon highlight group";
|
||||
};
|
||||
|
@ -56,7 +56,8 @@ in
|
|||
|
||||
config = mkIf cfg.enable {
|
||||
extraPlugins = with pkgs.vimPlugins; [
|
||||
cfg.package nvim-web-devicons
|
||||
cfg.package
|
||||
nvim-web-devicons
|
||||
];
|
||||
|
||||
# maps = genMaps cfg.keys;
|
||||
|
|
|
@ -25,7 +25,7 @@ in
|
|||
{
|
||||
options = {
|
||||
plugins.bufferline = {
|
||||
enable = mkEnableOption "Enable bufferline";
|
||||
enable = mkEnableOption "bufferline";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
description = "Plugin to use for bufferline";
|
||||
|
|
|
@ -7,7 +7,7 @@ in
|
|||
{
|
||||
options = {
|
||||
colorschemes.base16 = {
|
||||
enable = mkEnableOption "Enable base16";
|
||||
enable = mkEnableOption "base16";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
|
@ -7,7 +7,7 @@ in
|
|||
{
|
||||
options = {
|
||||
colorschemes.gruvbox = {
|
||||
enable = mkEnableOption "Enable gruvbox";
|
||||
enable = mkEnableOption "gruvbox";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
@ -15,10 +15,10 @@ in
|
|||
description = "Plugin to use for gruvbox";
|
||||
};
|
||||
|
||||
italics = mkEnableOption "Enable italics";
|
||||
bold = mkEnableOption "Enable bold";
|
||||
underline = mkEnableOption "Enable underlined text";
|
||||
undercurl = mkEnableOption "Enable undercurled text";
|
||||
italics = mkEnableOption "italics";
|
||||
bold = mkEnableOption "bold";
|
||||
underline = mkEnableOption "underlined text";
|
||||
undercurl = mkEnableOption "undercurled text";
|
||||
|
||||
contrastDark = mkOption {
|
||||
type = types.nullOr (types.enum [ "soft" "medium" "hard" ]);
|
||||
|
@ -110,9 +110,9 @@ in
|
|||
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 = {
|
||||
colorschemes.nord = {
|
||||
enable = mkEnableOption "Enable nord";
|
||||
enable = mkEnableOption "nord";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
|
@ -6,7 +6,7 @@ in
|
|||
{
|
||||
options = {
|
||||
colorschemes.one = {
|
||||
enable = mkEnableOption "Enable vim-one";
|
||||
enable = mkEnableOption "vim-one";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
|
@ -6,7 +6,7 @@ in
|
|||
{
|
||||
options = {
|
||||
colorschemes.onedark = {
|
||||
enable = mkEnableOption "Enable onedark";
|
||||
enable = mkEnableOption "onedark";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
|
@ -8,7 +8,7 @@ in
|
|||
{
|
||||
options = {
|
||||
colorschemes.tokyonight = {
|
||||
enable = mkEnableOption "Enable tokyonight";
|
||||
enable = mkEnableOption "tokyonight";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.vimPlugins.tokyonight-nvim;
|
||||
|
@ -24,8 +24,7 @@ in
|
|||
default = true;
|
||||
description = "Configure the colors used when opening a :terminal in Neovim";
|
||||
};
|
||||
transparent =
|
||||
mkEnableOption "Enable this to disable setting the background color";
|
||||
transparent = mkEnableOption "disable setting the background color";
|
||||
styles =
|
||||
let
|
||||
mkBackgroundStyle = name: mkOption {
|
||||
|
|
|
@ -6,7 +6,7 @@ in
|
|||
{
|
||||
options = {
|
||||
plugins.copilot = {
|
||||
enable = mkEnableOption "Enable copilot";
|
||||
enable = mkEnableOption "copilot";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
description = "The copilot plugin package to use";
|
||||
|
|
|
@ -9,7 +9,7 @@ in
|
|||
{
|
||||
options = {
|
||||
plugins.coq-nvim = {
|
||||
enable = mkEnableOption "Enable coq-nvim";
|
||||
enable = mkEnableOption "coq-nvim";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
|
@ -15,7 +15,7 @@ let
|
|||
in
|
||||
{
|
||||
options.plugins.nvim-cmp = {
|
||||
enable = mkEnableOption "Enable nvim-cmp";
|
||||
enable = mkEnableOption "nvim-cmp";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
|
@ -7,7 +7,7 @@ in
|
|||
{
|
||||
options = {
|
||||
plugins.gitgutter = {
|
||||
enable = mkEnableOption "Enable gitgutter";
|
||||
enable = mkEnableOption "gitgutter";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
helpers,
|
||||
...
|
||||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, helpers
|
||||
, ...
|
||||
}:
|
||||
with lib; let
|
||||
signOptions = defaults:
|
||||
|
@ -28,7 +27,7 @@ with lib; let
|
|||
description = "Specifies the highlight group to use for the line";
|
||||
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: {
|
||||
inherit (values) hl text numhl linehl;
|
||||
|
@ -41,7 +40,8 @@ with lib; let
|
|||
description = "Lua function definition";
|
||||
};
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
options.plugins.gitsigns = {
|
||||
enable = mkEnableOption "Enable gitsigns plugin";
|
||||
package = mkOption {
|
||||
|
@ -87,7 +87,8 @@ in {
|
|||
linehl = "GitSignsAddLn";
|
||||
};
|
||||
};
|
||||
worktrees = let
|
||||
worktrees =
|
||||
let
|
||||
worktreeModule = {
|
||||
options = {
|
||||
toplevel = mkOption {
|
||||
|
@ -166,29 +167,30 @@ in {
|
|||
'';
|
||||
};
|
||||
numhl = mkEnableOption ''
|
||||
Enable/disable line number highlights.
|
||||
line number highlights.
|
||||
|
||||
When enabled the highlights defined in `signs.*.numhl` are used. If
|
||||
the highlight group does not exist, then it is automatically defined
|
||||
and linked to the corresponding highlight group in `signs.*.hl`.
|
||||
'';
|
||||
linehl = mkEnableOption ''
|
||||
Enable/disable line highlights.
|
||||
line highlights.
|
||||
|
||||
When enabled the highlights defined in `signs.*.linehl` are used. If
|
||||
the highlight group does not exist, then it is automatically defined
|
||||
and linked to the corresponding highlight group in `signs.*.hl`.
|
||||
'';
|
||||
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`.
|
||||
'';
|
||||
diffOpts = let
|
||||
diffOpts =
|
||||
let
|
||||
diffOptModule = {
|
||||
options = {
|
||||
algorithm = mkOption {
|
||||
type = types.enum ["myers" "minimal" "patience" "histogram"];
|
||||
type = types.enum [ "myers" "minimal" "patience" "histogram" ];
|
||||
default = "myers";
|
||||
description = "Diff algorithm to use";
|
||||
};
|
||||
|
@ -307,7 +309,7 @@ in {
|
|||
description = "Whether to show a virtual text blame annotation";
|
||||
};
|
||||
virtTextPos = mkOption {
|
||||
type = types.enum ["eol" "overlay" "right_align"];
|
||||
type = types.enum [ "eol" "overlay" "right_align" ];
|
||||
default = "eol";
|
||||
description = "Blame annotation position";
|
||||
};
|
||||
|
@ -352,7 +354,7 @@ in {
|
|||
window.
|
||||
'';
|
||||
};
|
||||
yadm.enable = mkEnableOption "Enable YADM support";
|
||||
yadm.enable = mkEnableOption "YADM support";
|
||||
wordDiff = mkEnableOption ''
|
||||
Highlight intra-line word differences in the buffer.
|
||||
Requires `config.diff_opts.internal = true`.
|
||||
|
@ -363,24 +365,26 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
config = let
|
||||
config =
|
||||
let
|
||||
cfg = config.plugins.gitsigns;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
extraPlugins = with pkgs.vimPlugins; [
|
||||
cfg.package
|
||||
];
|
||||
extraConfigLua = let
|
||||
extraConfigLua =
|
||||
let
|
||||
luaFnOrStrToObj = val:
|
||||
if builtins.isString val
|
||||
then val
|
||||
else {__raw = val.function;};
|
||||
else { __raw = val.function; };
|
||||
setupOptions = {
|
||||
inherit (cfg) worktrees signcolumn numhl linehl trouble yadm;
|
||||
signs = mapAttrs (_: signSetupOptions) cfg.signs;
|
||||
on_attach =
|
||||
if cfg.onAttach != null
|
||||
then {__raw = cfg.onAttach.function;}
|
||||
then { __raw = cfg.onAttach.function; }
|
||||
else null;
|
||||
watch_gitdir = {
|
||||
inherit (cfg.watchGitDir) enable interval;
|
||||
|
@ -395,13 +399,16 @@ in {
|
|||
inherit (cfg.diffOpts) algorithm internal vertical linematch;
|
||||
indent_heuristic = cfg.diffOpts.indentHeuristic;
|
||||
};
|
||||
count_chars = let
|
||||
count_chars =
|
||||
let
|
||||
isStrInt = s: (builtins.match "[0-9]+" s) != null;
|
||||
in {
|
||||
in
|
||||
{
|
||||
__raw =
|
||||
"{"
|
||||
+ (concatStringsSep "," (
|
||||
lib.mapAttrsToList (
|
||||
lib.mapAttrsToList
|
||||
(
|
||||
name: value:
|
||||
if isStrInt name
|
||||
then "[${name}] = ${helpers.toLuaObject value}"
|
||||
|
@ -411,15 +418,17 @@ in {
|
|||
))
|
||||
+ "}";
|
||||
};
|
||||
status_formatter = {__raw = cfg.statusFormatter.function;};
|
||||
status_formatter = { __raw = cfg.statusFormatter.function; };
|
||||
max_file_length = cfg.maxFileLength;
|
||||
preview_config = cfg.previewConfig;
|
||||
attach_to_untracked = cfg.attachToUntracked;
|
||||
update_debounce = cfg.updateDebounce;
|
||||
current_line_blame = cfg.currentLineBlame;
|
||||
current_line_blame_opts = let
|
||||
current_line_blame_opts =
|
||||
let
|
||||
cfgCl = cfg.currentLineBlameOpts;
|
||||
in {
|
||||
in
|
||||
{
|
||||
inherit (cfgCl) delay;
|
||||
virt_text = cfgCl.virtText;
|
||||
virt_text_pos = cfgCl.virtTextPos;
|
||||
|
@ -431,7 +440,8 @@ in {
|
|||
word_diff = cfg.wordDiff;
|
||||
debug_mode = cfg.debugMode;
|
||||
};
|
||||
in ''
|
||||
in
|
||||
''
|
||||
require('gitsigns').setup(${helpers.toLuaObject setupOptions})
|
||||
'';
|
||||
};
|
||||
|
|
|
@ -16,7 +16,7 @@ in
|
|||
{
|
||||
options = {
|
||||
plugins.neogit = {
|
||||
enable = mkEnableOption "Enable neogit";
|
||||
enable = mkEnableOption "neogit";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
{ pkgs
|
||||
, lib
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
with lib; {
|
||||
options.plugins.plantuml-syntax = {
|
||||
enable = mkEnableOption "Enable plantuml syntax support";
|
||||
enable = mkEnableOption "plantuml syntax support";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
@ -26,7 +25,8 @@ with lib; {
|
|||
};
|
||||
};
|
||||
|
||||
config = let
|
||||
config =
|
||||
let
|
||||
cfg = config.plugins.plantuml-syntax;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
helpers,
|
||||
...
|
||||
{ pkgs
|
||||
, config
|
||||
, lib
|
||||
, helpers
|
||||
, ...
|
||||
}:
|
||||
with lib; {
|
||||
options.plugins.rust-tools = let
|
||||
mkNullableOptionWithDefault = {
|
||||
type,
|
||||
description,
|
||||
default,
|
||||
options.plugins.rust-tools =
|
||||
let
|
||||
mkNullableOptionWithDefault =
|
||||
{ type
|
||||
, description
|
||||
, default
|
||||
,
|
||||
}:
|
||||
mkOption {
|
||||
type = types.nullOr type;
|
||||
|
@ -42,8 +43,9 @@ with lib; {
|
|||
type = types.int;
|
||||
default = toString default;
|
||||
};
|
||||
in {
|
||||
enable = mkEnableOption "Enable rust tools plugins";
|
||||
in
|
||||
{
|
||||
enable = mkEnableOption "rust tools plugins";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.vimPlugins.rust-tools-nvim;
|
||||
|
@ -51,7 +53,7 @@ with lib; {
|
|||
};
|
||||
|
||||
executor = mkNullableOptionWithDefault {
|
||||
type = types.enum ["termopen" "quickfix"];
|
||||
type = types.enum [ "termopen" "quickfix" ];
|
||||
default = ''"termopen"'';
|
||||
description = "how to execute terminal commands";
|
||||
};
|
||||
|
@ -152,29 +154,33 @@ with lib; {
|
|||
}
|
||||
// (import ../nvim-lsp/rust-analyzer-config.nix lib);
|
||||
};
|
||||
config = let
|
||||
config =
|
||||
let
|
||||
cfg = config.plugins.rust-tools;
|
||||
in
|
||||
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 = {
|
||||
tools = {
|
||||
executor =
|
||||
if cfg.executor != null
|
||||
then {__raw = ''require("rust-tools.executors").${cfg.executor}'';}
|
||||
then { __raw = ''require("rust-tools.executors").${cfg.executor}''; }
|
||||
else null;
|
||||
|
||||
on_initialized =
|
||||
if cfg.onIntialized != null
|
||||
then {__raw = cfg.onIntialized;}
|
||||
then { __raw = cfg.onIntialized; }
|
||||
else null;
|
||||
|
||||
reload_workspace_from_cargo_toml = cfg.reloadWorkspaceFromCargoToml;
|
||||
inlay_hints = let
|
||||
inlay_hints =
|
||||
let
|
||||
cfgIH = cfg.inlayHints;
|
||||
in {
|
||||
in
|
||||
{
|
||||
auto = cfgIH.auto;
|
||||
only_current_line = cfgIH.onlyCurrentLine;
|
||||
show_parameter_hints = cfgIH.showParameterHints;
|
||||
|
@ -187,18 +193,22 @@ with lib; {
|
|||
highlight = cfgIH.highlight;
|
||||
};
|
||||
|
||||
hover_actions = let
|
||||
hover_actions =
|
||||
let
|
||||
cfgHA = cfg.hoverActions;
|
||||
in {
|
||||
in
|
||||
{
|
||||
border = cfgHA.border;
|
||||
max_width = cfgHA.maxWidth;
|
||||
max_height = cfgHA.maxHeight;
|
||||
auto_focus = cfgHA.autoFocus;
|
||||
};
|
||||
|
||||
crate_graph = let
|
||||
crate_graph =
|
||||
let
|
||||
cfgCG = cfg.crateGraph;
|
||||
in {
|
||||
in
|
||||
{
|
||||
backend = cfgCG.backend;
|
||||
output = cfgCG.output;
|
||||
full = cfgCG.full;
|
||||
|
@ -208,10 +218,11 @@ with lib; {
|
|||
server = {
|
||||
standalone = cfg.server.standalone;
|
||||
settings.rust-analyzer = lib.filterAttrs (n: v: n != "standalone") cfg.server;
|
||||
on_attach = {__raw = "__lspOnAttach";};
|
||||
on_attach = { __raw = "__lspOnAttach"; };
|
||||
};
|
||||
};
|
||||
in ''
|
||||
in
|
||||
''
|
||||
require('rust-tools').setup(${helpers.toLuaObject setupOptions})
|
||||
'';
|
||||
};
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
}:
|
||||
with lib; {
|
||||
options.plugins.treesitter-context = {
|
||||
enable = mkEnableOption "Enable nvim-treesitter-context";
|
||||
enable = mkEnableOption "nvim-treesitter-context";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
|
@ -15,7 +15,7 @@ with lib; {
|
|||
{
|
||||
enable =
|
||||
mkEnableOption
|
||||
"Enable treesitter-refactor (requires plugins.treesitter.enable to be true)";
|
||||
"treesitter-refactor (requires plugins.treesitter.enable to be true)";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
@ -39,7 +39,7 @@ with lib; {
|
|||
};
|
||||
highlightCurrentScope = {
|
||||
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 = {
|
||||
inherit disable;
|
||||
|
|
|
@ -7,7 +7,7 @@ in
|
|||
{
|
||||
options = {
|
||||
plugins.treesitter = {
|
||||
enable = mkEnableOption "Enable tree-sitter syntax highlighting";
|
||||
enable = mkEnableOption "tree-sitter syntax highlighting";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
@ -66,7 +66,7 @@ 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 = {
|
||||
initSelection = keymap "gnn";
|
||||
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 {
|
||||
type = with types; listOf package;
|
||||
|
|
|
@ -10,7 +10,7 @@ in
|
|||
];
|
||||
|
||||
options.plugins.null-ls = {
|
||||
enable = mkEnableOption "Enable null-ls";
|
||||
enable = mkEnableOption "null-ls";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
mkServer =
|
||||
{ name
|
||||
, sourceType
|
||||
, description ? "Enable ${name} source, for null-ls."
|
||||
, description ? "${name} source, for null-ls."
|
||||
, package ? null
|
||||
, extraPackages ? [ ]
|
||||
, ...
|
||||
|
|
|
@ -11,7 +11,7 @@ in
|
|||
|
||||
options = {
|
||||
plugins.lsp = {
|
||||
enable = mkEnableOption "Enable neovim's built-in LSP";
|
||||
enable = mkEnableOption "neovim's built-in LSP";
|
||||
|
||||
enabledServers = mkOption {
|
||||
type = with types; listOf (oneOf [
|
||||
|
|
|
@ -7,7 +7,7 @@ in
|
|||
{
|
||||
options = {
|
||||
plugins.lspsaga = {
|
||||
enable = mkEnableOption "Enable lspsava.nvim";
|
||||
enable = mkEnableOption "lspsaga.nvim";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
@ -111,13 +111,15 @@ in
|
|||
description = "Maximum finder preview lines";
|
||||
};
|
||||
|
||||
keys = let
|
||||
keys =
|
||||
let
|
||||
defaultKeyOpt = desc: mkOption {
|
||||
description = desc;
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
finderAction = {
|
||||
open = defaultKeyOpt "Open from finder";
|
||||
vsplit = defaultKeyOpt "Vertical split in finder";
|
||||
|
@ -147,9 +149,10 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = let
|
||||
config =
|
||||
let
|
||||
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;
|
||||
lspsagaConfig = {
|
||||
use_saga_diagnostic_sign = notDefault true cfg.signs.use;
|
||||
|
@ -175,14 +178,18 @@ in
|
|||
|
||||
rename_prompt_prefix = notNull cfg.renamePromptPrefix;
|
||||
|
||||
border_style = let
|
||||
borderStyle = if cfg.borderStyle == "thin" then 1
|
||||
border_style =
|
||||
let
|
||||
borderStyle =
|
||||
if cfg.borderStyle == "thin" then 1
|
||||
else if cfg.borderStyle == "rounded" then 2
|
||||
else if cfg.borderStyle == "thick" then 3
|
||||
else null;
|
||||
in borderStyle;
|
||||
in
|
||||
borderStyle;
|
||||
|
||||
finder_action_keys = let
|
||||
finder_action_keys =
|
||||
let
|
||||
keys = {
|
||||
open = notNull cfg.keys.finderAction.open;
|
||||
vsplit = notNull cfg.keys.finderAction.vsplit;
|
||||
|
@ -191,16 +198,20 @@ in
|
|||
scroll_down = notNull cfg.keys.finderAction.scrollDown;
|
||||
scroll_up = notNull cfg.keys.finderAction.scrollUp;
|
||||
};
|
||||
in notEmpty keys;
|
||||
in
|
||||
notEmpty keys;
|
||||
|
||||
code_action_keys = let
|
||||
code_action_keys =
|
||||
let
|
||||
keys = {
|
||||
quit = notNull cfg.keys.codeAction.quit;
|
||||
exec = notNull cfg.keys.codeAction.exec;
|
||||
};
|
||||
in notEmpty keys;
|
||||
in
|
||||
notEmpty keys;
|
||||
};
|
||||
in mkIf cfg.enable {
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
|
||||
extraPlugins = [ cfg.package ];
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ in
|
|||
{
|
||||
options = {
|
||||
plugins.packer = {
|
||||
enable = mkEnableOption "Enable packer.nvim";
|
||||
enable = mkEnableOption "packer.nvim";
|
||||
|
||||
plugins = mkOption {
|
||||
type = types.listOf (types.oneOf [
|
||||
|
|
|
@ -14,7 +14,7 @@ in
|
|||
{
|
||||
options = {
|
||||
plugins.airline = {
|
||||
enable = mkEnableOption "Enable airline";
|
||||
enable = mkEnableOption "airline";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
|
@ -7,7 +7,7 @@ in
|
|||
{
|
||||
options = {
|
||||
plugins.lightline = {
|
||||
enable = mkEnableOption "Enable lightline";
|
||||
enable = mkEnableOption "lightline";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
|
@ -56,7 +56,7 @@ in
|
|||
{
|
||||
options = {
|
||||
plugins.lualine = {
|
||||
enable = mkEnableOption "Enable lualine";
|
||||
enable = mkEnableOption "lualine";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
|
@ -16,7 +16,7 @@ in
|
|||
# TODO:add support for aditional filetypes. This requires autocommands!
|
||||
|
||||
options.plugins.telescope = {
|
||||
enable = mkEnableOption "Enable telescope.nvim";
|
||||
enable = mkEnableOption "telescope.nvim";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
@ -68,12 +68,14 @@ in
|
|||
let $BAT_THEME = '${cfg.highlightTheme}'
|
||||
'';
|
||||
|
||||
extraConfigLua = let
|
||||
extraConfigLua =
|
||||
let
|
||||
options = {
|
||||
extensions = cfg.extensionConfig;
|
||||
defaults = cfg.defaults;
|
||||
} // cfg.extraOptions;
|
||||
in ''
|
||||
in
|
||||
''
|
||||
do
|
||||
local __telescopeExtensions = ${helpers.toLuaObject cfg.enabledExtensions}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ let
|
|||
in
|
||||
{
|
||||
options.plugins.telescope.extensions.frecency = {
|
||||
enable = mkEnableOption "Enable frecency";
|
||||
enable = mkEnableOption "frecency";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
@ -50,7 +50,8 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = let
|
||||
config =
|
||||
let
|
||||
configuration = {
|
||||
db_root = cfg.dbRoot;
|
||||
default_workspace = cfg.defaultWorkspace;
|
||||
|
@ -60,7 +61,8 @@ in
|
|||
show_unindexed = cfg.showUnindexed;
|
||||
devicons_disabled = cfg.deviconsDisabled;
|
||||
};
|
||||
in mkIf cfg.enable {
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
extraPackages = [ pkgs.sqlite ];
|
||||
extraPlugins = with pkgs.vimPlugins; [
|
||||
cfg.package
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{ pkgs, config, lib, ...}:
|
||||
{ pkgs, config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.plugins.telescope.extensions.project-nvim;
|
||||
in
|
||||
{
|
||||
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 = {
|
||||
plugins.commentary = {
|
||||
enable = mkEnableOption "Enable commentary";
|
||||
enable = mkEnableOption "commentary";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
|
@ -8,7 +8,7 @@ in
|
|||
{
|
||||
options = {
|
||||
plugins.dashboard = {
|
||||
enable = mkEnableOption "Enable dashboard";
|
||||
enable = mkEnableOption "dashboard";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
|
@ -7,7 +7,7 @@ in
|
|||
{
|
||||
options = {
|
||||
plugins.floaterm = {
|
||||
enable = mkEnableOption "Enable floaterm";
|
||||
enable = mkEnableOption "floaterm";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
|
@ -8,7 +8,7 @@ let
|
|||
in
|
||||
{
|
||||
options.plugins.mark-radar = {
|
||||
enable = mkEnableOption "Enable mark-radar";
|
||||
enable = mkEnableOption "mark-radar";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
|
@ -10,7 +10,7 @@ let
|
|||
in
|
||||
{
|
||||
options.plugins.notify = {
|
||||
enable = mkEnableOption "Enable notify";
|
||||
enable = mkEnableOption "notify";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
|
@ -6,7 +6,7 @@ let
|
|||
in
|
||||
{
|
||||
options.plugins.nvim-autopairs = {
|
||||
enable = mkEnableOption "Enable nvim-autopairs";
|
||||
enable = mkEnableOption "nvim-autopairs";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
|
@ -6,7 +6,7 @@ let
|
|||
in
|
||||
{
|
||||
options.plugins.nvim-tree = {
|
||||
enable = mkEnableOption "Enable nvim-tree";
|
||||
enable = mkEnableOption "nvim-tree";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
|
@ -6,7 +6,7 @@ let
|
|||
in
|
||||
{
|
||||
options.plugins.project-nvim = helpers.extraOptionsOptions // {
|
||||
enable = mkEnableOption "Enable project.nvim";
|
||||
enable = mkEnableOption "project.nvim";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
|
@ -6,7 +6,7 @@ let
|
|||
in
|
||||
{
|
||||
options.plugins.specs = {
|
||||
enable = mkEnableOption "Enable specs-nvim";
|
||||
enable = mkEnableOption "specs-nvim";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue