Created build module

This commit is contained in:
isaacST08 2025-01-23 19:35:00 -07:00
commit 44959a0c8a
6 changed files with 820 additions and 302 deletions

View file

@ -0,0 +1,107 @@
{
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
;
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
];
options.vim.languages.tex.build = {
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.
'';
};
};
}