misc: refactor imports, prefer adding helpers to args rather than importing it

This commit is contained in:
Gaetan Lepage
2023-11-06 16:33:39 +01:00
committed by Gaétan Lepage
parent 541b694873
commit b6724702b4
160 changed files with 697 additions and 736 deletions
+2 -3
View File
@@ -1,11 +1,10 @@
{
config,
lib,
helpers,
config,
...
}:
with lib; let
helpers = import ../lib/helpers.nix {inherit lib;};
autoGroupOption = types.submodule {
options = {
clear = mkOption {
+1 -1
View File
@@ -1,6 +1,6 @@
{
config,
lib,
config,
pkgs,
...
}:
+2 -2
View File
@@ -1,10 +1,10 @@
{
config,
lib,
helpers,
config,
...
}:
with lib; let
helpers = import ../lib/helpers.nix {inherit lib;};
commandAttributes = types.submodule {
options = {
command = mkOption {
+3 -3
View File
@@ -1,10 +1,10 @@
{
config,
lib,
helpers,
config,
...
} @ args:
}:
with lib; let
helpers = import ../lib/helpers.nix args;
filetypeDefinition = helpers.mkNullOrOption (types.attrsOf (
types.oneOf [
# Raw filetype
+48 -49
View File
@@ -1,58 +1,57 @@
{
config,
lib,
helpers,
config,
...
}: let
helpers = import ../lib/helpers.nix {inherit lib;};
in
with lib; {
options = {
highlight = mkOption {
type = types.attrsOf helpers.highlightType;
default = {};
description = "Define highlight groups";
example = ''
highlight = {
Comment.fg = '#ff0000';
};
'';
};
match = mkOption {
type = types.attrsOf types.str;
default = {};
description = "Define match groups";
example = ''
match = {
ExtraWhitespace = '\\s\\+$';
};
'';
};
}:
with lib; {
options = {
highlight = mkOption {
type = types.attrsOf helpers.highlightType;
default = {};
description = "Define highlight groups";
example = ''
highlight = {
Comment.fg = '#ff0000';
};
'';
};
config = mkIf (config.highlight != {} || config.match != {}) {
extraConfigLuaPost =
(optionalString (config.highlight != {}) ''
-- Highlight groups {{
do
local highlights = ${helpers.toLuaObject config.highlight}
match = mkOption {
type = types.attrsOf types.str;
default = {};
description = "Define match groups";
example = ''
match = {
ExtraWhitespace = '\\s\\+$';
};
'';
};
};
for k,v in pairs(highlights) do
vim.api.nvim_set_hl(0, k, v)
config = mkIf (config.highlight != {} || config.match != {}) {
extraConfigLuaPost =
(optionalString (config.highlight != {}) ''
-- Highlight groups {{
do
local highlights = ${helpers.toLuaObject config.highlight}
for k,v in pairs(highlights) do
vim.api.nvim_set_hl(0, k, v)
end
end
-- }}
'')
+ (optionalString (config.match != {}) ''
-- Match groups {{
do
local match = ${helpers.toLuaObject config.match}
for k,v in pairs(match) do
vim.fn.matchadd(k, v)
end
end
-- }}
'')
+ (optionalString (config.match != {}) ''
-- Match groups {{
do
local match = ${helpers.toLuaObject config.match}
for k,v in pairs(match) do
vim.fn.matchadd(k, v)
end
end
-- }}
'');
};
}
'');
};
}
+3 -4
View File
@@ -1,11 +1,10 @@
{
config,
lib,
helpers,
config,
...
}:
with lib; let
helpers = import ../lib/helpers.nix {inherit lib;};
in {
with lib; {
options = {
maps =
mapAttrs
+1 -1
View File
@@ -1,6 +1,6 @@
{
config,
lib,
config,
...
}:
with lib; let
+3 -4
View File
@@ -1,11 +1,10 @@
{
config,
lib,
helpers,
config,
...
}:
with lib; let
helpers = import ../lib/helpers.nix {inherit lib;};
in {
with lib; {
options = {
options = mkOption {
type = types.attrsOf types.anything;
+1 -2
View File
@@ -1,7 +1,6 @@
{
pkgs,
config,
lib,
config,
...
}:
with lib; let
+2 -2
View File
@@ -1,12 +1,12 @@
{
lib,
pkgs,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.barbar;
helpers = import ../helpers.nix {inherit lib;};
bufferOptions = {
bufferIndex = helpers.mkNullOrOption types.bool ''
+2 -2
View File
@@ -1,12 +1,12 @@
{
lib,
pkgs,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.barbecue;
helpers = import ../helpers.nix {inherit lib;};
mkListStr = helpers.defaultNullOpts.mkNullable (types.listOf types.str);
in {
options.plugins.barbecue =
+3 -3
View File
@@ -1,12 +1,12 @@
{
lib,
helpers,
config,
pkgs,
lib,
...
} @ args:
}:
with lib; let
cfg = config.plugins.bufferline;
helpers = import ../helpers.nix args;
highlightOption = {
fg = helpers.mkNullOrOption types.str "foreground color";
+2 -3
View File
@@ -1,13 +1,12 @@
{
lib,
pkgs,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.navic;
helpers = import ../helpers.nix {inherit lib;};
mkListStr = helpers.defaultNullOpts.mkNullable (types.listOf types.str);
in {
options.plugins.navic =
helpers.extraOptionsOptions
+4 -4
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
} @ args:
}:
with lib; let
cfg = config.colorschemes.ayu;
helpers = import ../helpers.nix args;
in {
options = {
colorschemes.ayu =
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.colorschemes.base16;
helpers = import ../helpers.nix {inherit lib;};
themes = import ./base16-list.nix;
in {
options = {
+4 -4
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
} @ args:
}:
with lib; let
cfg = config.colorschemes.catppuccin;
helpers = import ../helpers.nix args;
flavours = [
"latte"
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.colorschemes.dracula;
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
colorschemes.dracula = {
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
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 {
options = {
+3 -3
View File
@@ -1,12 +1,12 @@
{
lib,
helpers,
pkgs,
config,
lib,
...
} @ args:
}:
with lib; let
cfg = config.colorschemes.kanagawa;
helpers = import ../helpers.nix args;
in {
options = {
colorschemes.kanagawa =
+3 -3
View File
@@ -1,17 +1,17 @@
{
pkgs,
lib,
helpers,
pkgs,
config,
...
}: let
inherit (lib) mkEnableOption mkDefault mkIf;
inherit (import ../helpers.nix {inherit lib;}) mkPackageOption;
cfg = config.colorschemes.melange;
in {
options = {
colorschemes.melange = {
enable = mkEnableOption "Melange colorscheme";
package = mkPackageOption "melange.nvim" pkgs.vimPlugins.melange-nvim;
package = helpers.mkPackageOption "melange.nvim" pkgs.vimPlugins.melange-nvim;
};
};
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.colorschemes.nord;
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
colorschemes.nord = {
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.colorschemes.one;
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
colorschemes.one = {
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.colorschemes.onedark;
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
colorschemes.onedark = {
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.colorschemes.oxocarbon;
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
colorschemes.oxocarbon = {
+3 -3
View File
@@ -1,12 +1,12 @@
{
lib,
helpers,
pkgs,
config,
lib,
...
} @ args:
}:
with lib; let
cfg = config.colorschemes.poimandres;
helpers = import ../helpers.nix args;
in {
options = {
colorschemes.poimandres =
+4 -4
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
} @ args:
}:
with lib; let
cfg = config.colorschemes.rose-pine;
helpers = import ../helpers.nix args;
in {
options = {
colorschemes.rose-pine = {
+4 -4
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
} @ args:
}:
with lib; let
cfg = config.colorschemes.tokyonight;
helpers = import ../helpers.nix args;
in {
options = {
colorschemes.tokyonight = {
+2 -2
View File
@@ -1,12 +1,12 @@
{
lib,
helpers,
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.plugins.copilot-lua;
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
plugins.copilot-lua = let
+2 -2
View File
@@ -1,12 +1,12 @@
{
lib,
helpers,
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.plugins.copilot-vim;
helpers = import ../helpers.nix {inherit lib;};
in {
imports = [
(lib.mkRenamedOptionModule ["plugins" "copilot"] ["plugins" "copilot-vim"])
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.coq-thirdparty;
helpers = import ../helpers.nix {inherit lib;};
in {
options.plugins.coq-thirdparty = {
enable = mkEnableOption "coq-thirdparty";
+2 -2
View File
@@ -1,12 +1,12 @@
{
pkgs,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.coq-nvim;
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
plugins.coq-nvim = {
+2 -2
View File
@@ -1,12 +1,12 @@
{
lib,
helpers,
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.plugins.lspkind;
helpers = import ../helpers.nix {inherit lib;};
in {
options.plugins.lspkind =
helpers.extraOptionsOptions
+3 -2
View File
@@ -1,8 +1,9 @@
{
lib,
config,
pkgs,
...
} @ attrs: let
}: let
helpers = import ../../helpers.nix {inherit lib;};
in
with helpers;
@@ -13,7 +14,7 @@ in
useDefaultPackage ? true,
...
}:
mkPlugin attrs {
mkPlugin {inherit lib config pkgs;} {
inherit name;
extraPlugins = extraPlugins ++ (lists.optional useDefaultPackage pkgs.vimPlugins.${name});
description = "Enable ${name}";
+2 -2
View File
@@ -1,12 +1,12 @@
{
lib,
helpers,
pkgs,
config,
lib,
...
} @ args:
with lib; let
cfg = config.plugins.nvim-cmp;
helpers = import ../../helpers.nix {inherit lib;};
cmpLib = import ./cmp-helpers.nix args;
snippetEngines = {
@@ -1,12 +1,11 @@
{
pkgs,
config,
lib,
helpers,
config,
...
}:
with lib; let
cfg = config.plugins.cmp-tabnine;
helpers = import ../../../helpers.nix {inherit lib;};
in {
options.plugins.cmp-tabnine = helpers.extraOptionsOptions;
@@ -1,12 +1,12 @@
{
config,
lib,
helpers,
config,
...
}:
with lib; let
copilot-lua-cfg = config.plugins.copilot-lua;
cfg = config.plugins.copilot-cmp;
helpers = import ../../../helpers.nix {inherit lib;};
in {
options.plugins.copilot-cmp =
helpers.extraOptionsOptions
@@ -1,11 +1,11 @@
{
config,
lib,
helpers,
config,
...
}:
with lib; let
cfg = config.plugins.crates-nvim;
helpers = import ../../../helpers.nix {inherit lib;};
in {
options.plugins.crates-nvim = helpers.extraOptionsOptions;
@@ -1,11 +1,12 @@
{
lib,
config,
pkgs,
...
} @ attrs:
}:
with lib; let
cmpLib = import ../cmp-helpers.nix attrs;
cmpSourcesPluginNames = lib.attrValues cmpLib.pluginAndSourceNames;
cmpLib = import ../cmp-helpers.nix {inherit lib config pkgs;};
cmpSourcesPluginNames = attrValues cmpLib.pluginAndSourceNames;
pluginModules = lists.map (name: cmpLib.mkCmpSourcePlugin {inherit name;}) cmpSourcesPluginNames;
in {
# For extra cmp plugins
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.dap.extensions.dap-go;
helpers = import ../helpers.nix {inherit lib;};
dapHelpers = import ./dapHelpers.nix {inherit lib;};
in {
options.plugins.dap.extensions.dap-go = {
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.dap.extensions.dap-python;
helpers = import ../helpers.nix {inherit lib;};
dapHelpers = import ./dapHelpers.nix {inherit lib;};
in {
options.plugins.dap.extensions.dap-python = {
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.dap.extensions.dap-ui;
helpers = import ../helpers.nix {inherit lib;};
mkSizeOption =
helpers.mkNullOrOption
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.dap.extensions.dap-virtual-text;
helpers = import ../helpers.nix {inherit lib;};
in {
options.plugins.dap.extensions.dap-virtual-text = {
enable = mkEnableOption "dap-virtual-text";
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.dap;
helpers = import ../helpers.nix {inherit lib;};
dapHelpers = import ./dapHelpers.nix {inherit lib;};
in
with dapHelpers; {
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.chadtree;
helpers = import ../helpers.nix {inherit lib;};
mkListStr = helpers.defaultNullOpts.mkNullable (types.listOf types.str);
in {
options.plugins.chadtree =
+3 -4
View File
@@ -1,13 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.neo-tree;
helpers = import ../helpers.nix {inherit lib;};
basePluginPath = ["plugins" "neo-tree"];
in {
imports = [
+3 -3
View File
@@ -1,12 +1,12 @@
{
lib,
helpers,
pkgs,
config,
lib,
...
} @ args:
}:
with lib; let
cfg = config.plugins.nvim-tree;
helpers = import ../helpers.nix {inherit lib;};
inherit (helpers) ifNonNull';
openWinConfigOption =
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.diffview;
helpers = import ../helpers.nix {inherit lib;};
mkWinConfig = type: width: height: position:
with helpers.defaultNullOpts; {
type = mkEnum ["split" "float"] type ''
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.git-worktree;
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
plugins.git-worktree = {
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.gitblame;
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
plugins.gitblame = {
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.gitgutter;
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
plugins.gitgutter = {
+4 -5
View File
@@ -1,12 +1,11 @@
{
pkgs,
lib,
helpers,
config,
pkgs,
...
} @ args:
with lib; let
helpers = import ../helpers.nix args;
in {
}:
with lib; {
options.plugins.gitmessenger = {
enable = mkEnableOption "gitmessenger";
+3 -3
View File
@@ -1,11 +1,11 @@
{
config,
lib,
helpers,
config,
pkgs,
...
} @ args:
}:
with lib; let
helpers = import ../helpers.nix args;
signOptions = defaults: {
hl =
helpers.defaultNullOpts.mkStr defaults.hl
+2 -2
View File
@@ -1,12 +1,12 @@
{
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.neogit;
helpers = import ../helpers.nix {inherit lib;};
sectionDefaultsModule = types.submodule {
options = {
+2 -2
View File
@@ -1,12 +1,12 @@
{
lib,
pkgs,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.clangd-extensions;
helpers = import ../helpers.nix {inherit lib;};
basePluginPath = ["plugins" "clangd-extensions"];
+2 -2
View File
@@ -1,11 +1,11 @@
{
pkgs,
lib,
helpers,
pkgs,
config,
...
}: let
cfg = config.plugins.julia-cell;
helpers = import ../../helpers.nix {inherit lib;};
# The keys are the option name in nixvim (under plugins.julia-cell.keymaps)
# cmd: Such that the mapping action is ':JuliaCell${cmd}<CR>'
+1 -1
View File
@@ -1,6 +1,6 @@
{
pkgs,
lib,
pkgs,
...
} @ args:
with lib;
+2 -2
View File
@@ -1,12 +1,12 @@
{
lib,
helpers,
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.plugins.markdown-preview;
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
plugins.markdown-preview = {
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.nvim-jdtls;
helpers = import ../helpers.nix {inherit lib;};
in {
options.plugins.nvim-jdtls =
helpers.extraOptionsOptions
+3 -3
View File
@@ -1,12 +1,12 @@
{
lib,
pkgs,
helpers,
config,
pkgs,
...
} @ args:
}:
with lib; let
defaultFuzzyFinder = "skim";
helpers = import ../helpers.nix args;
in {
options.plugins.openscad = {
enable = mkEnableOption "openscad.nvim, a plugin to manage OpenSCAD files";
+3 -4
View File
@@ -1,12 +1,11 @@
{
pkgs,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
helpers = import ../helpers.nix {inherit lib;};
in {
with lib; {
options.plugins.plantuml-syntax = {
enable = mkEnableOption "plantuml syntax support";
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.rust-tools;
helpers = import ../helpers.nix {inherit lib;};
in {
options.plugins.rust-tools =
helpers.extraOptionsOptions
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.sniprun;
helpers = import ../helpers.nix {inherit lib;};
mkList = helpers.defaultNullOpts.mkNullable (types.listOf types.str);
in {
+2 -2
View File
@@ -1,11 +1,11 @@
{
pkgs,
lib,
helpers,
config,
pkgs,
...
}: let
cfg = config.plugins.tagbar;
helpers = import ../helpers.nix {inherit lib;};
in
with lib; {
options.plugins.tagbar = {
@@ -1,12 +1,11 @@
{
pkgs,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
helpers = import ../../helpers.nix {inherit lib;};
in {
with lib; {
# TODO those warnings have been added XX/XX/2023
# -> Remove them in ~ 1 month (oct. 2023)
imports =
@@ -1,12 +1,12 @@
{
pkgs,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.treesitter-context;
helpers = import ../../helpers.nix {inherit lib;};
in {
# Those warnings were introduced on 08/25/2023. TODO: remove them in October 2023.
imports = let
@@ -1,12 +1,11 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
helpers = import ../../helpers.nix {inherit lib;};
in {
with lib; {
options.plugins.treesitter-refactor = let
disable = mkOption {
type = types.listOf types.str;
+2 -2
View File
@@ -1,12 +1,12 @@
{
pkgs,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.treesitter;
helpers = import ../../helpers.nix {inherit lib;};
in {
options = {
plugins.treesitter = {
@@ -1,12 +1,11 @@
{
pkgs,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
helpers = import ../../helpers.nix {inherit lib;};
in {
with lib; {
options.plugins.ts-context-commentstring =
helpers.extraOptionsOptions
// {
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.typst-vim;
helpers = import ../../helpers.nix {inherit lib;};
in {
options.plugins.typst-vim =
helpers.extraOptionsOptions
+2 -2
View File
@@ -1,11 +1,11 @@
{
pkgs,
lib,
helpers,
config,
pkgs,
...
}: let
cfg = config.plugins.vim-slime;
helpers = import ../helpers.nix {inherit lib;};
in
with lib; {
options.plugins.vim-slime = {
+2 -2
View File
@@ -1,11 +1,11 @@
{
pkgs,
lib,
helpers,
config,
pkgs,
...
}: let
cfg = config.plugins.vimtex;
helpers = import ../helpers.nix {inherit lib;};
in
with lib; {
options.plugins.vimtex = {
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.conform-nvim;
helpers = import ../helpers.nix {inherit lib;};
in {
options.plugins.conform-nvim =
helpers.extraOptionsOptions
+2 -2
View File
@@ -1,12 +1,12 @@
{
lib,
helpers,
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.plugins.lsp;
helpers = import ../helpers.nix {inherit lib;};
in {
imports = [
./language-servers
+2 -2
View File
@@ -1,12 +1,12 @@
{
lib,
helpers,
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.plugins.fidget;
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
plugins.fidget =
+1 -1
View File
@@ -1,7 +1,7 @@
{
lib,
pkgs,
config,
lib,
...
}: {
mkLsp = {
+3 -4
View File
@@ -1,12 +1,11 @@
{
lib,
helpers,
config,
pkgs,
...
} @ args:
with lib; let
helpers = import ../helpers.nix args;
in {
}:
with lib; {
options.plugins.inc-rename = {
enable = mkEnableOption "inc-rename, a plugin previewing LSP renaming";
+1 -2
View File
@@ -1,11 +1,10 @@
{
pkgs,
lib,
helpers,
config,
...
}:
with lib; let
helpers = import ../../helpers.nix {inherit lib;};
cfg = config.plugins.lsp.servers.ccls;
in {
# Options: https://github.com/MaskRay/ccls/wiki/Customization#initialization-options
+5 -4
View File
@@ -1,11 +1,12 @@
{
pkgs,
lib,
helpers,
config,
pkgs,
...
} @ args:
}:
with lib; let
lspHelpers = import ../helpers.nix args;
helpers = import ../../helpers.nix {inherit lib;};
lspHelpers = import ../helpers.nix {inherit lib config pkgs;};
servers = [
{
@@ -1,12 +1,11 @@
{
lib,
helpers,
config,
pkgs,
lib,
...
}:
with lib; let
helpers = import ../../helpers.nix {inherit lib;};
tools = trivial.importJSON ./efmls-configs-tools.json;
inherit (tools) linters formatters;
+1 -1
View File
@@ -1,11 +1,11 @@
{
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
helpers = import ../../helpers.nix {inherit lib;};
cfg = config.plugins.lsp.servers.nixd;
in {
# Options: https://github.com/nix-community/nixd/blob/main/docs/user-guide.md#configuration
+2 -2
View File
@@ -1,11 +1,11 @@
{
pkgs,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
helpers = import ../../helpers.nix {inherit lib;};
cfg = config.plugins.lsp.servers.pylsp;
in {
# All settings are documented here:
+1 -1
View File
@@ -1,10 +1,10 @@
{
lib,
helpers,
config,
...
}:
with lib; let
helpers = import ../../helpers.nix {inherit lib;};
cfg = config.plugins.lsp.servers.svelte;
in {
# Options: https://github.com/sveltejs/language-tools/tree/master/packages/language-server#settings
+2 -2
View File
@@ -1,12 +1,12 @@
{
pkgs,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.lsp-format;
helpers = import ../helpers.nix {inherit lib;};
in {
options.plugins.lsp-format =
helpers.extraOptionsOptions
+2 -2
View File
@@ -1,12 +1,12 @@
{
pkgs,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.lsp-lines;
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
plugins.lsp-lines = {
+2 -2
View File
@@ -1,12 +1,12 @@
{
pkgs,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.lspsaga;
helpers = import ../helpers.nix {inherit lib;};
mkKeymapOption = default:
helpers.defaultNullOpts.mkNullable
+78 -79
View File
@@ -1,90 +1,89 @@
{
pkgs,
lib,
helpers,
config,
pkgs,
...
}: let
helpers = import ../helpers.nix {inherit lib;};
in
with lib; {
options.plugins.nvim-lightbulb = {
enable = mkEnableOption "nvim-lightbulb, showing available code actions";
}:
with lib; {
options.plugins.nvim-lightbulb = {
enable = mkEnableOption "nvim-lightbulb, showing available code actions";
package = helpers.mkPackageOption "nvim-lightbulb" pkgs.vimPlugins.nvim-lightbulb;
package = helpers.mkPackageOption "nvim-lightbulb" pkgs.vimPlugins.nvim-lightbulb;
ignore = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
LSP client names to ignore
'';
ignore = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
LSP client names to ignore
'';
sign = {
enabled = helpers.defaultNullOpts.mkBool true "";
priority = helpers.defaultNullOpts.mkInt 10 "";
};
float = {
enabled = helpers.defaultNullOpts.mkBool false "";
text = helpers.defaultNullOpts.mkStr "💡" "Text to show in the popup float";
winOpts = helpers.defaultNullOpts.mkNullable (types.attrsOf types.anything) "{}" ''
Options for the floating window (see |vim.lsp.util.open_floating_preview| for more information)
'';
};
virtualText = {
enabled = helpers.defaultNullOpts.mkBool false "";
text = helpers.defaultNullOpts.mkStr "💡" "Text to show at virtual text";
hlMode = helpers.defaultNullOpts.mkStr "replace" ''
highlight mode to use for virtual text (replace, combine, blend), see
:help nvim_buf_set_extmark() for reference
'';
};
statusText = {
enabled = helpers.defaultNullOpts.mkBool false "";
text = helpers.defaultNullOpts.mkStr "💡" "Text to provide when code actions are available";
textUnavailable = helpers.defaultNullOpts.mkStr "" ''
Text to provide when no actions are available
'';
};
autocmd = {
enabled = helpers.defaultNullOpts.mkBool false "";
pattern = helpers.defaultNullOpts.mkNullable (types.listOf types.str) ''["*"]'' "";
events =
helpers.defaultNullOpts.mkNullable (types.listOf types.str)
''["CursorHold" "CursorHoldI"]'' "";
};
sign = {
enabled = helpers.defaultNullOpts.mkBool true "";
priority = helpers.defaultNullOpts.mkInt 10 "";
};
config = let
cfg = config.plugins.nvim-lightbulb;
setupOptions = {
inherit (cfg) ignore sign autocmd;
float = {
inherit (cfg.float) enabled text;
win_opts = cfg.float.winOpts;
};
virtual_text = {
inherit (cfg.virtualText) enabled text;
hl_mode = cfg.virtualText.hlMode;
};
status_text = {
inherit (cfg.statusText) enabled text;
text_unavailable = cfg.statusText.textUnavailable;
};
float = {
enabled = helpers.defaultNullOpts.mkBool false "";
text = helpers.defaultNullOpts.mkStr "💡" "Text to show in the popup float";
winOpts = helpers.defaultNullOpts.mkNullable (types.attrsOf types.anything) "{}" ''
Options for the floating window (see |vim.lsp.util.open_floating_preview| for more information)
'';
};
virtualText = {
enabled = helpers.defaultNullOpts.mkBool false "";
text = helpers.defaultNullOpts.mkStr "💡" "Text to show at virtual text";
hlMode = helpers.defaultNullOpts.mkStr "replace" ''
highlight mode to use for virtual text (replace, combine, blend), see
:help nvim_buf_set_extmark() for reference
'';
};
statusText = {
enabled = helpers.defaultNullOpts.mkBool false "";
text = helpers.defaultNullOpts.mkStr "💡" "Text to provide when code actions are available";
textUnavailable = helpers.defaultNullOpts.mkStr "" ''
Text to provide when no actions are available
'';
};
autocmd = {
enabled = helpers.defaultNullOpts.mkBool false "";
pattern = helpers.defaultNullOpts.mkNullable (types.listOf types.str) ''["*"]'' "";
events =
helpers.defaultNullOpts.mkNullable (types.listOf types.str)
''["CursorHold" "CursorHoldI"]'' "";
};
};
config = let
cfg = config.plugins.nvim-lightbulb;
setupOptions = {
inherit (cfg) ignore sign autocmd;
float = {
inherit (cfg.float) enabled text;
win_opts = cfg.float.winOpts;
};
in
mkIf cfg.enable {
extraPlugins = [cfg.package];
extraConfigLua = ''
require("nvim-lightbulb").setup(${helpers.toLuaObject setupOptions})
'';
virtual_text = {
inherit (cfg.virtualText) enabled text;
hl_mode = cfg.virtualText.hlMode;
};
}
status_text = {
inherit (cfg.statusText) enabled text;
text_unavailable = cfg.statusText.textUnavailable;
};
};
in
mkIf cfg.enable {
extraPlugins = [cfg.package];
extraConfigLua = ''
require("nvim-lightbulb").setup(${helpers.toLuaObject setupOptions})
'';
};
}
+2 -2
View File
@@ -1,11 +1,11 @@
{
lib,
helpers,
config,
pkgs,
lib,
...
}: let
cfg = config.plugins.trouble;
helpers = import ../helpers.nix {inherit lib;};
in
with lib; {
options.plugins.trouble =
+2 -2
View File
@@ -1,12 +1,12 @@
{
lib,
helpers,
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.plugins.none-ls;
helpers = import ../helpers.nix {inherit lib;};
in {
imports = [
./servers.nix
-5
View File
@@ -1,9 +1,4 @@
{
pkgs,
config,
lib,
...
}: {
mkServer = {
name,
sourceType,
+2 -2
View File
@@ -3,8 +3,8 @@
config,
lib,
...
} @ args: let
helpers = import ./helpers.nix args;
}: let
helpers = import ./helpers.nix;
serverData = {
code_actions = {
eslint = {
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.packer;
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
plugins.packer = {
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.luasnip;
helpers = import ../../helpers.nix {inherit lib;};
in {
options.plugins.luasnip = {
enable = mkEnableOption "luasnip";
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.airline;
helpers = import ../helpers.nix {inherit lib;};
sectionType = with types; nullOr (oneOf [str (listOf str)]);
sectionOption = mkOption {
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.lightline;
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
plugins.lightline = {
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.lualine;
helpers = import ../helpers.nix {inherit lib;};
mkSeparatorsOption = {
leftDefault ? " ",
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.telescope;
helpers = import ../helpers.nix {inherit lib;};
in {
imports = [
./file-browser.nix
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.telescope.extensions.file_browser;
helpers = import ../helpers.nix {inherit lib;};
hiddenOption = types.submodule {
options = {
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.telescope.extensions.frecency;
helpers = import ../helpers.nix {inherit lib;};
in {
options.plugins.telescope.extensions.frecency = {
enable = mkEnableOption "frecency";
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.telescope.extensions.fzf-native;
helpers = import ../helpers.nix {inherit lib;};
in {
options.plugins.telescope.extensions.fzf-native = {
enable = mkEnableOption "fzf-native";
+3 -3
View File
@@ -1,12 +1,12 @@
{
pkgs,
config,
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.plugins.telescope.extensions.media_files;
helpers = import ../helpers.nix {inherit lib;};
in {
options.plugins.telescope.extensions.media_files = {
enable = mkEnableOption "media_files extension for telescope";

Some files were not shown because too many files have changed in this diff Show More