neovim-flake/modules/plugins/languages/tex/build/builders/latexmk.nix

60 lines
1.3 KiB
Nix
Raw Normal View History

2025-01-24 10:49:26 -07:00
# TODO: I need testing.
{
pkgs,
lib,
...
2025-02-10 15:24:39 -07:00
} @ moduleInheritancePackage: let
2025-01-24 10:49:26 -07:00
# The name of the builder
name = "latexmk";
# The builder template
template = import ./builderTemplate.nix;
inherit (lib) optionals;
2025-01-24 10:49:26 -07:00
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) bool package str;
in (
template {
2025-02-10 15:24:39 -07:00
inherit name moduleInheritancePackage;
2025-01-24 10:49:26 -07:00
options = {
enable = mkEnableOption "Tex Compilation Via latexmk";
2025-01-24 10:49:26 -07:00
package = mkOption {
type = package;
2025-02-10 15:24:39 -07:00
default = pkgs.texlive.withPackages (ps: [ps.latexmk]);
2025-01-24 10:49:26 -07:00
description = "latexmk package";
};
executable = mkOption {
type = str;
default = "latexmk";
description = ''
The executable name from the build package that will be used to
build/compile the tex.
'';
2025-01-24 10:49:26 -07:00
};
# Flag options
pdfOutput = mkOption {
type = bool;
default = true;
example = false;
description = "Insure the output file is a pdf.";
};
};
# Optional flags must come before the base args because of how the latexmk
# command works
2025-01-24 10:49:26 -07:00
args = builderCfg: (
# Flags
(optionals builderCfg.pdfOutput ["-pdf"])
2025-01-24 10:49:26 -07:00
# Base args
++ [
"-quiet"
"%f"
]
);
}
)