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

This commit is contained in:
Gaetan Lepage 2023-11-06 15:04:08 +01:00 committed by Gaétan Lepage
parent 541b694873
commit b6724702b4
160 changed files with 697 additions and 736 deletions

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"];

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>'

View file

@ -1,6 +1,6 @@
{
pkgs,
lib,
pkgs,
...
} @ args:
with lib;

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 = {

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

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";

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";

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

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 {

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 = {

View file

@ -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 =

View file

@ -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

View file

@ -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;

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 = {

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.ts-context-commentstring =
helpers.extraOptionsOptions
// {

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

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 = {

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 = {