mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2025-12-20 07:00:09 +01:00
58 lines
1.2 KiB
Nix
58 lines
1.2 KiB
Nix
|
|
# TODO: I need testing.
|
||
|
|
{
|
||
|
|
pkgs,
|
||
|
|
lib,
|
||
|
|
...
|
||
|
|
} @ moduleInheritancePackage: let
|
||
|
|
# The name of the builder
|
||
|
|
name = "latexmk";
|
||
|
|
|
||
|
|
# The builder template
|
||
|
|
template = import ./builderTemplate.nix;
|
||
|
|
|
||
|
|
inherit (lib.options) mkOption mkEnableOption;
|
||
|
|
inherit (lib.types) bool package str;
|
||
|
|
in (
|
||
|
|
template {
|
||
|
|
inherit name moduleInheritancePackage;
|
||
|
|
|
||
|
|
options = {
|
||
|
|
enable = mkEnableOption "Whether to enable Tex Compilation Via latexmk";
|
||
|
|
|
||
|
|
package = mkOption {
|
||
|
|
type = package;
|
||
|
|
default = pkgs.texlive.withPackages (ps: [ps.latexmk]);
|
||
|
|
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.";
|
||
|
|
};
|
||
|
|
|
||
|
|
# Flag options
|
||
|
|
pdfOutput = mkOption {
|
||
|
|
type = bool;
|
||
|
|
default = true;
|
||
|
|
example = false;
|
||
|
|
description = "Insure the output file is a pdf.";
|
||
|
|
};
|
||
|
|
};
|
||
|
|
|
||
|
|
args = builderCfg: (
|
||
|
|
# Flags
|
||
|
|
(
|
||
|
|
if builderCfg.pdfOutput
|
||
|
|
then ["-pdf"]
|
||
|
|
else []
|
||
|
|
)
|
||
|
|
# Base args
|
||
|
|
++ [
|
||
|
|
"-quiet"
|
||
|
|
"%f"
|
||
|
|
]
|
||
|
|
);
|
||
|
|
}
|
||
|
|
)
|