From fcb6f82892ad1c5831cb369a0328f2abb677f47f Mon Sep 17 00:00:00 2001 From: LilleAila Date: Sun, 19 Jan 2025 18:01:43 +0100 Subject: [PATCH 1/8] highlight: init --- docs/release-notes/rl-0.8.md | 1 + modules/neovim/init/default.nix | 1 + modules/neovim/init/highlight.nix | 106 ++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 modules/neovim/init/highlight.nix diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 42927baf..f835abf1 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -102,6 +102,7 @@ - `mini.trailspace` - `mini.visits` - Add [fzf-lua](https://github.com/ibhagwan/fzf-lua) in `vim.fzf-lua` +- Add options to define highlights under `vim.highlight` [kaktu5](https://github.com/kaktu5): diff --git a/modules/neovim/init/default.nix b/modules/neovim/init/default.nix index 11d9cf59..b0c7e0ce 100644 --- a/modules/neovim/init/default.nix +++ b/modules/neovim/init/default.nix @@ -2,6 +2,7 @@ imports = [ ./basic.nix ./debug.nix + ./highlight.nix ./spellcheck.nix ]; } diff --git a/modules/neovim/init/highlight.nix b/modules/neovim/init/highlight.nix new file mode 100644 index 00000000..d00fe74a --- /dev/null +++ b/modules/neovim/init/highlight.nix @@ -0,0 +1,106 @@ +{ + config, + lib, + ... +}: let + inherit (lib.options) mkOption literalExpression; + inherit (lib.types) nullOr attrsOf listOf submodule bool ints str; + inherit (lib.strings) hasPrefix concatStringsSep; + inherit (lib.attrsets) mapAttrsToList; + inherit (lib.nvim.dag) entryAnywhere; + inherit (lib.nvim.lua) toLuaObject; + inherit (lib.nvim.types) hexColor; + + mkColorOption = target: + mkOption { + type = nullOr hexColor; + default = null; + description = '' + The ${target} color to use. Written as color name or hex "#RRGGBB". + ''; + example = "#ebdbb2"; + }; + + mkBoolOption = name: + mkOption { + type = nullOr bool; + default = null; + description = ''Whether to enable ${name}''; + example = false; + }; + + cfg = config.vim.highlight; +in { + options.vim.highlight = mkOption { + type = attrsOf (submodule { + # See :h nvim_set_hl + options = { + bg = mkColorOption "background"; + fg = mkColorOption "foreground"; + sp = mkColorOption "special"; + blend = mkOption { + type = nullOr (ints.between 0 100); + default = null; + description = "Blend as an integer between 0 and 100"; + }; + bold = mkBoolOption "bold"; + standout = mkBoolOption "standout"; + underline = mkBoolOption "underline"; + undercurl = mkBoolOption "undercurl"; + underdouble = mkBoolOption "underdouble"; + underdotted = mkBoolOption "underdotted"; + underdashed = mkBoolOption "underdashed"; + strikethrough = mkBoolOption "strikethrough"; + italic = mkBoolOption "italic"; + reverse = mkBoolOption "reverse"; + nocombine = mkBoolOption "nocombine"; + link = mkOption { + type = nullOr str; + default = null; + description = "The name of another highlight group to link to"; + }; + default = mkOption { + type = nullOr bool; + default = null; + description = "Don't override existing definition"; + }; + ctermfg = mkOption { + type = nullOr str; + default = null; + description = "The cterm foreground color to use"; + }; + ctermbg = mkOption { + type = nullOr str; + default = null; + description = "The cterm background color to use"; + }; + cterm = mkOption { + type = nullOr (listOf str); + default = null; + description = "The cterm arguments to use. See :h highlight-args"; + }; + force = mkBoolOption "force update"; + }; + }); + default = {}; + description = "Custom highlight to apply"; + example = literalExpression '' + { + SignColumn = { + bg = "#282828"; + }; + } + ''; + }; + + config = { + vim.luaConfigRC.highlight = let + highlights = + mapAttrsToList ( + name: value: ''vim.api.nvim_set_hl(0, ${toLuaObject name}, ${toLuaObject value})'' + ) + cfg; + in + entryAnywhere (concatStringsSep "\n" highlights); + }; +} From 5e3a0dcdc32259e50a78d763a6f5720b73b1de5e Mon Sep 17 00:00:00 2001 From: LilleAila Date: Sun, 19 Jan 2025 18:11:12 +0100 Subject: [PATCH 2/8] highlight: cterm as enum --- modules/neovim/init/highlight.nix | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/modules/neovim/init/highlight.nix b/modules/neovim/init/highlight.nix index d00fe74a..8c110cac 100644 --- a/modules/neovim/init/highlight.nix +++ b/modules/neovim/init/highlight.nix @@ -4,7 +4,7 @@ ... }: let inherit (lib.options) mkOption literalExpression; - inherit (lib.types) nullOr attrsOf listOf submodule bool ints str; + inherit (lib.types) nullOr attrsOf listOf submodule bool ints str enum; inherit (lib.strings) hasPrefix concatStringsSep; inherit (lib.attrsets) mapAttrsToList; inherit (lib.nvim.dag) entryAnywhere; @@ -75,7 +75,22 @@ in { description = "The cterm background color to use"; }; cterm = mkOption { - type = nullOr (listOf str); + type = nullOr (listOf (enum [ + "bold" + "underline" + "undercurl" + "underdouble" + "underdotted" + "underdashed" + "strikethrough" + "reverse" + "inverse" + "italic" + "standout" + "altfont" + "nocombine" + "NONE" + ])); default = null; description = "The cterm arguments to use. See :h highlight-args"; }; From 653e5d6a176378386e803c767aa8da4dbdd96f11 Mon Sep 17 00:00:00 2001 From: LilleAila Date: Sun, 19 Jan 2025 19:36:32 +0100 Subject: [PATCH 3/8] highlight: implement suggestions --- docs/release-notes/rl-0.8.md | 2 +- modules/neovim/init/highlight.nix | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index f835abf1..7fe3d2e5 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -102,7 +102,7 @@ - `mini.trailspace` - `mini.visits` - Add [fzf-lua](https://github.com/ibhagwan/fzf-lua) in `vim.fzf-lua` -- Add options to define highlights under `vim.highlight` +- Add options to define highlights under [](#opt-vim.highlight) [kaktu5](https://github.com/kaktu5): diff --git a/modules/neovim/init/highlight.nix b/modules/neovim/init/highlight.nix index 8c110cac..606f1c05 100644 --- a/modules/neovim/init/highlight.nix +++ b/modules/neovim/init/highlight.nix @@ -3,11 +3,11 @@ lib, ... }: let - inherit (lib.options) mkOption literalExpression; + inherit (lib.options) mkOption; inherit (lib.types) nullOr attrsOf listOf submodule bool ints str enum; - inherit (lib.strings) hasPrefix concatStringsSep; + inherit (lib.strings) hasPrefix concatLines; inherit (lib.attrsets) mapAttrsToList; - inherit (lib.nvim.dag) entryAnywhere; + inherit (lib.nvim.dag) entryBetween; inherit (lib.nvim.lua) toLuaObject; inherit (lib.nvim.types) hexColor; @@ -15,18 +15,18 @@ mkOption { type = nullOr hexColor; default = null; + example = "#ebdbb2"; description = '' The ${target} color to use. Written as color name or hex "#RRGGBB". ''; - example = "#ebdbb2"; }; mkBoolOption = name: mkOption { type = nullOr bool; default = null; - description = ''Whether to enable ${name}''; example = false; + description = "Whether to enable ${name}"; }; cfg = config.vim.highlight; @@ -98,14 +98,14 @@ in { }; }); default = {}; - description = "Custom highlight to apply"; - example = literalExpression '' + example = '' { SignColumn = { bg = "#282828"; }; } ''; + description = "Custom highlights to apply"; }; config = { @@ -116,6 +116,6 @@ in { ) cfg; in - entryAnywhere (concatStringsSep "\n" highlights); + entryBetween ["lazyConfigs" "pluginConfigs" "extraPluginConfigs"] ["theme"] (concatLines highlights); }; } From 28bbe89fbc92ff6a1b6c180d9812ee6ddf706207 Mon Sep 17 00:00:00 2001 From: LilleAila Date: Mon, 20 Jan 2025 14:16:45 +0100 Subject: [PATCH 4/8] highlight: example without '' --- modules/neovim/init/highlight.nix | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/neovim/init/highlight.nix b/modules/neovim/init/highlight.nix index 606f1c05..8c7eca82 100644 --- a/modules/neovim/init/highlight.nix +++ b/modules/neovim/init/highlight.nix @@ -98,13 +98,11 @@ in { }; }); default = {}; - example = '' - { - SignColumn = { - bg = "#282828"; - }; - } - ''; + example = { + SignColumn = { + bg = "#282828"; + }; + }; description = "Custom highlights to apply"; }; From f58f41629f82ea7c88a84333ba261369194fe7de Mon Sep 17 00:00:00 2001 From: LilleAila Date: Mon, 20 Jan 2025 14:28:36 +0100 Subject: [PATCH 5/8] highlight: :h reference in single quotes --- modules/neovim/init/highlight.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/neovim/init/highlight.nix b/modules/neovim/init/highlight.nix index 8c7eca82..7e992fd1 100644 --- a/modules/neovim/init/highlight.nix +++ b/modules/neovim/init/highlight.nix @@ -92,7 +92,7 @@ in { "NONE" ])); default = null; - description = "The cterm arguments to use. See :h highlight-args"; + description = "The cterm arguments to use. See ':h highlight-args'"; }; force = mkBoolOption "force update"; }; From 4b6021073cd9aa09f75c4c2e89fa18cd3224793a Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Wed, 22 Jan 2025 12:16:03 +0300 Subject: [PATCH 6/8] flake: bump nixpkgs --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index c328bda1..ee19b7c8 100644 --- a/flake.lock +++ b/flake.lock @@ -77,11 +77,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1735523292, - "narHash": "sha256-opBsbR/nrGxiiF6XzlVluiHYb6yN/hEwv+lBWTy9xoM=", + "lastModified": 1737370608, + "narHash": "sha256-hFA6SmioeqvGW/XvZa9bxniAeulksCOcj3kokdNT/YE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "6d97d419e5a9b36e6293887a89a078cf85f5a61b", + "rev": "300081d0cc72df578b02d914df941b8ec62240e6", "type": "github" }, "original": { From 9b524fbe1c5516812b6a99f893db93ce5c074c83 Mon Sep 17 00:00:00 2001 From: isaacST08 Date: Thu, 23 Jan 2025 19:44:59 -0700 Subject: [PATCH 7/8] Cleanup after makeing build module --- .../languages/tex/build/builders/custom.nix | 27 +- .../languages/tex/build/builders/default.nix | 29 +- .../languages/tex/build/builders/tectonic.nix | 18 +- .../plugins/languages/tex/build/default.nix | 36 +- modules/plugins/languages/tex/lsp/texlab.nix | 328 +----------------- 5 files changed, 15 insertions(+), 423 deletions(-) diff --git a/modules/plugins/languages/tex/build/builders/custom.nix b/modules/plugins/languages/tex/build/builders/custom.nix index 680d37a9..749bf6be 100644 --- a/modules/plugins/languages/tex/build/builders/custom.nix +++ b/modules/plugins/languages/tex/build/builders/custom.nix @@ -6,30 +6,7 @@ }: let inherit (lib.options) mkOption; inherit (lib.modules) mkIf; - inherit - (lib.types) - bool - enum - ints - listOf - package - str - ; - inherit - (builtins) - attrNames - concatLists - concatStringsSep - elem - elemAt - filter - hasAttr - isAttrs - length - map - throw - toString - ; + inherit (lib.types) bool listOf package str ; cfg = config.vim.languages.tex; @@ -81,6 +58,8 @@ in { vim.languages.tex.build.builder = { name = "custom"; args = collateArgs cfg.build; + package = cfg.build.builders.custom.package; + executable = cfg.build.builders.custom.executable; }; }; } diff --git a/modules/plugins/languages/tex/build/builders/default.nix b/modules/plugins/languages/tex/build/builders/default.nix index da00fbdb..d772bb04 100644 --- a/modules/plugins/languages/tex/build/builders/default.nix +++ b/modules/plugins/languages/tex/build/builders/default.nix @@ -1,35 +1,12 @@ { config, - pkgs, lib, ... }: let - inherit (lib.options) mkOption mkEnableOption; - inherit - (lib.types) - bool - enum - ints - listOf - package - str - ; - inherit - (builtins) - attrNames - concatLists - concatStringsSep - elem - elemAt - filter - hasAttr - isAttrs - length - map - throw - toString - ; + inherit (lib.options) mkOption; + inherit (lib.types) enum listOf package str; + inherit (builtins) attrNames; cfg = config.vim.languages.tex; in diff --git a/modules/plugins/languages/tex/build/builders/tectonic.nix b/modules/plugins/languages/tex/build/builders/tectonic.nix index 0ec8bea0..29188cf2 100644 --- a/modules/plugins/languages/tex/build/builders/tectonic.nix +++ b/modules/plugins/languages/tex/build/builders/tectonic.nix @@ -15,21 +15,7 @@ package str ; - inherit - (builtins) - attrNames - concatLists - concatStringsSep - elem - elemAt - filter - hasAttr - isAttrs - length - map - throw - toString - ; + inherit (builtins) concatLists elem map toString; cfg = config.vim.languages.tex; @@ -40,7 +26,6 @@ example = !default; description = description; }); - mkEnableLspOption = mkEnableDefaultOption config.vim.languages.enableLSP; # --- Arg Collation Functions -- collateArgs = buildConfig: let @@ -226,6 +211,7 @@ in { name = "tectonic"; args = collateArgs cfg.build; package = cfg.build.builders.tectonic.package; + executable = cfg.build.builders.tectonic.package; }; }; } diff --git a/modules/plugins/languages/tex/build/default.nix b/modules/plugins/languages/tex/build/default.nix index 0882565e..cbc9dca7 100644 --- a/modules/plugins/languages/tex/build/default.nix +++ b/modules/plugins/languages/tex/build/default.nix @@ -1,46 +1,12 @@ { config, - pkgs, lib, ... }: let inherit (lib.options) mkOption; - inherit (lib.modules) mkIf; - inherit - (lib.types) - bool - enum - ints - listOf - package - str - ; - inherit - (builtins) - attrNames - concatLists - concatStringsSep - elem - elemAt - filter - hasAttr - isAttrs - length - map - throw - toString - ; + inherit (lib.types) bool str; cfg = config.vim.languages.tex; - - # --- Enable Options --- - mkEnableDefaultOption = default: description: (mkOption { - type = bool; - default = default; - example = !default; - description = description; - }); - mkEnableLspOption = mkEnableDefaultOption config.vim.languages.enableLSP; in { imports = [ ./builders diff --git a/modules/plugins/languages/tex/lsp/texlab.nix b/modules/plugins/languages/tex/lsp/texlab.nix index 498a6017..fd319a6d 100644 --- a/modules/plugins/languages/tex/lsp/texlab.nix +++ b/modules/plugins/languages/tex/lsp/texlab.nix @@ -22,8 +22,6 @@ inherit (lib.types) bool - enum - ints listOf package str @@ -31,9 +29,7 @@ inherit (builtins) attrNames - concatLists concatStringsSep - elem elemAt filter hasAttr @@ -54,87 +50,6 @@ description = description; }); mkEnableLspOption = mkEnableDefaultOption config.vim.languages.enableLSP; - - # --- Arg Collation Functions -- - # collateArgs.lsp.texlab.build = { - # tectonic = buildConfig: let - # selfConfig = buildConfig.tectonic; - # in ( - # # Base args - # [ - # "-X" - # "compile" - # "%f" - # ] - # # Flags - # ++ ( - # if selfConfig.keepIntermediates - # then ["--keep-intermediates"] - # else [] - # ) - # ++ ( - # if selfConfig.keepLogs - # then ["--keep-logs"] - # else [] - # ) - # ++ ( - # if selfConfig.onlyCached - # then ["--only-cached"] - # else [] - # ) - # ++ ( - # if selfConfig.synctex - # then ["--synctex"] - # else [] - # ) - # ++ ( - # if selfConfig.untrustedInput - # then ["--untrusted"] - # else [] - # ) - # # Options - # ++ ( - # if selfConfig.reruns > 0 - # then ["--reruns" "${toString selfConfig.reruns}"] - # else [] - # ) - # ++ ( - # if selfConfig.bundle != "" - # then ["--bundle" "${toString selfConfig.bundle}"] - # else [] - # ) - # ++ ( - # if selfConfig.webBundle != "" - # then ["--web-bundle" "${toString selfConfig.webBundle}"] - # else [] - # ) - # ++ ( - # if selfConfig.outfmt != "" - # then ["--outfmt" "${toString selfConfig.outfmt}"] - # else [] - # ) - # ++ (concatLists (map (x: ["--hide" x]) selfConfig.hidePaths)) - # ++ ( - # if selfConfig.format != "" - # then ["--format" "${toString selfConfig.format}"] - # else [] - # ) - # ++ ( - # if selfConfig.color != "" - # then ["--color" "${toString selfConfig.color}"] - # else [] - # ) - # # Still options but these are not defined by builder specific options but - # # instead synchronize options between the global build options and builder - # # specific options - # ++ ( - # if !(elem buildConfig.pdfDirectory ["." ""]) - # then ["--outdir" "${buildConfig.pdfDirectory}"] - # else [] - # ) - # ); - # custom = buildConfig: buildConfig.custom.args; # Moved - # }; in { options.vim.languages.tex.lsp.texlab = { enable = mkEnableLspOption "Whether to enable Tex LSP support (texlab)"; @@ -145,201 +60,6 @@ in { description = "texlab package"; }; - # build = { - # tectonic = { - # enable = mkEnableDefaultOption true "Whether to enable Tex Compilation Via Tectonic"; - # - # package = mkOption { - # type = package; - # default = pkgs.tectonic; - # description = "tectonic package"; - # }; - # - # executable = mkOption { - # type = str; - # default = "tectonic"; - # description = "The executable name from the build package that will be used to build/compile the tex."; - # }; - # - # # -- Flags -- - # keepIntermediates = mkEnableDefaultOption false '' - # Keep the intermediate files generated during processing. - # - # If texlab is reporting build errors when there shouldn't be, disable this option. - # ''; - # keepLogs = mkEnableDefaultOption true '' - # Keep the log files generated during processing. - # - # Without the keepLogs flag, texlab won't be able to report compilation warnings. - # ''; - # onlyCached = mkEnableDefaultOption false "Use only resource files cached locally"; - # synctex = mkEnableDefaultOption true "Generate SyncTeX data"; - # untrustedInput = mkEnableDefaultOption false "Input is untrusted -- disable all known-insecure features"; - # - # # -- Options -- - # reruns = mkOption { - # type = ints.unsigned; - # default = 0; - # example = 2; - # description = "Rerun the TeX engine exactly this many times after the first"; - # }; - # - # bundle = mkOption { - # type = str; - # default = ""; - # description = "Use this directory or Zip-format bundle file to find resource files instead of the default"; - # }; - # - # webBundle = mkOption { - # type = str; - # default = ""; - # description = "Use this URL to find resource files instead of the default"; - # }; - # - # outfmt = mkOption { - # type = enum [ - # "pdf" - # "html" - # "xdv" - # "aux" - # "fmt" - # "" - # ]; - # default = ""; - # description = "The kind of output to generate"; - # }; - # - # hidePaths = mkOption { - # type = listOf str; - # default = []; - # example = [ - # "./secrets.tex" - # "./passwords.tex" - # ]; - # description = "Tell the engine that no file at exists, if it tries to read it."; - # }; - # - # format = mkOption { - # type = str; - # default = ""; - # description = "The name of the \"format\" file used to initialize the TeX engine"; - # }; - # - # color = mkOption { - # type = enum [ - # "always" - # "auto" - # "never" - # "" - # ]; - # default = ""; - # example = "always"; - # description = "Enable/disable colorful log output"; - # }; - # - # extraOptions = { - # type = listOf str; - # default = []; - # description = '' - # Add extra command line options to include in the tectonic build command. - # Extra options added here will not overwrite the options set in as nvf options. - # ''; - # }; - # }; - - # # Moved - # custom = { - # enable = mkEnableDefaultOption false "Whether to enable using a custom build package"; - # package = mkOption { - # type = package; - # default = pkgs.tectonic; - # description = "build/compiler package"; - # }; - # executable = mkOption { - # type = str; - # default = "tectonic"; - # description = "The executable name from the build package that will be used to build/compile the tex."; - # }; - # args = mkOption { - # type = listOf str; - # default = [ - # "-X" - # "compile" - # "%f" - # "--synctex" - # "--keep-logs" - # "--keep-intermediates" - # ]; - # description = '' - # Defines additional arguments that are passed to the configured LaTeX build tool. - # Note that flags and their arguments need to be separate elements in this array. - # To pass the arguments -foo bar to a build tool, args needs to be ["-foo" "bar"]. - # The placeholder `%f` will be replaced by the server. - # - # Placeholders: - # - `%f`: The path of the TeX file to compile. - # ''; - # }; - # }; - - # forwardSearchAfter = mkOption { - # type = bool; - # default = false; - # description = "Set this property to true if you want to execute a forward search after a build."; - # }; - # onSave = mkOption { - # type = bool; - # default = false; - # description = "Set this property to true if you want to compile the project after saving a file."; - # }; - # useFileList = mkOption { - # type = bool; - # default = false; - # description = '' - # When set to true, the server will use the .fls files produced by the TeX engine as an additional input for the project detection. - # - # Note that enabling this property might have an impact on performance. - # ''; - # }; - # auxDirectory = mkOption { - # type = str; - # default = "."; - # description = '' - # When not using latexmk, provides a way to define the directory containing the .aux files. - # Note that you need to set the aux directory in latex.build.args too. - # - # When using a latexmkrc file, texlab will automatically infer the correct setting. - # ''; - # }; - # logDirectory = mkOption { - # type = str; - # default = "."; - # description = '' - # When not using latexmk, provides a way to define the directory containing the build log files. - # Note that you need to change the output directory in your build arguments too. - # - # When using a latexmkrc file, texlab will automatically infer the correct setting. - # ''; - # }; - # pdfDirectory = mkOption { - # type = str; - # default = "."; - # description = '' - # When not using latexmk, provides a way to define the directory containing the output files. - # Note that you need to set the output directory in latex.build.args too. - # - # When using a latexmkrc file, texlab will automatically infer the correct setting. - # ''; - # }; - # filename = mkOption { - # type = str; - # default = ""; - # description = '' - # Allows overriding the default file name of the build artifact. This setting is used to find the correct PDF file to open during forward search. - # ''; - # }; - # }; - forwardSearch = { enable = mkOption { type = bool; @@ -442,42 +162,8 @@ in { # -- Build -- buildConfig = let - # This function will sort through the builder options of ...texlab.build and count how many - # builders have been enabled and get the attrs of the last enabled builder. - # getBuilder = { - # enabledBuildersCount ? 0, - # enabledBuilderName ? "", - # index ? 0, - # builderNamesList ? ( - # filter ( - # x: let - # y = cfg.build.builders.${x}; - # in (isAttrs y && hasAttr "enable" y) - # ) (attrNames cfg.build.builders) - # ), - # }: let - # currentBuilderName = elemAt builderNamesList index; - # currentBuilder = tl.build.${currentBuilderName}; - # nextIndex = index + 1; - # currentState = { - # enabledBuildersCount = - # if currentBuilder.enable - # then enabledBuildersCount + 1 - # else enabledBuildersCount; - # enabledBuilderName = - # if currentBuilder.enable - # then currentBuilderName - # else enabledBuilderName; - # }; - # in - # if length builderNamesList > nextIndex - # then - # getBuilder ({ - # inherit builderNamesList; - # index = nextIndex; - # } - # // currentState) - # else currentState; + # This function will sort through the builder options and count how many + # builders have been enabled. getEnabledBuildersCount = { enabledBuildersCount ? 0, index ? 0, @@ -500,15 +186,13 @@ in { if length builderNamesList > nextIndex then getEnabledBuildersCount { - inherit builderNamesList; - enabledBuildersCount = newEnabledBuildersCount; - index = nextIndex; - } + inherit builderNamesList; + enabledBuildersCount = newEnabledBuildersCount; + index = nextIndex; + } else newEnabledBuildersCount; enabledBuildersCount = getEnabledBuildersCount {}; - # builder = tl.build.${getBuilderResults.enabledBuilderName}; - # builderArgs = collateArgs.lsp.texlab.build.${getBuilderResults.enabledBuilderName} tl.build; in if enabledBuildersCount == 0 then "" From 13da2ae7552ad974631555a99cfaff0b2f2cfd80 Mon Sep 17 00:00:00 2001 From: isaacST08 Date: Thu, 23 Jan 2025 19:50:17 -0700 Subject: [PATCH 8/8] Fixed typo --- modules/plugins/languages/tex/build/builders/tectonic.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/plugins/languages/tex/build/builders/tectonic.nix b/modules/plugins/languages/tex/build/builders/tectonic.nix index 29188cf2..82f4b8b2 100644 --- a/modules/plugins/languages/tex/build/builders/tectonic.nix +++ b/modules/plugins/languages/tex/build/builders/tectonic.nix @@ -211,7 +211,7 @@ in { name = "tectonic"; args = collateArgs cfg.build; package = cfg.build.builders.tectonic.package; - executable = cfg.build.builders.tectonic.package; + executable = cfg.build.builders.tectonic.executable; }; }; }