aboutsummaryrefslogtreecommitdiff
path: root/module.nix
diff options
context:
space:
mode:
Diffstat (limited to 'module.nix')
-rw-r--r--module.nix28
1 files changed, 25 insertions, 3 deletions
diff --git a/module.nix b/module.nix
index 0aa7fff..c385bea 100644
--- a/module.nix
+++ b/module.nix
@@ -3,7 +3,6 @@ let
inherit (lib)
mkIf
mkOption
- mkPackageOption
mkEnableOption
types
;
@@ -15,10 +14,25 @@ in
{
options = {
texShell = {
- scheme = mkPackageOption pkgs "texliveSmall" { };
+ scheme = mkOption {
+ type = types.packages;
+ default = pkgs.texliveSmall;
+ description = ''
+ The base texlive scheme to use. Choose between:
+ - pkgs.texliveSmall
+ - pkgs.texliveMedium
+ - pkgs.texliveFull
+ - pkgs.texliveBasic
+ - pkgs.texliveMinimal
+ - pkgs.texliveTeTex
+ '';
+ };
extraPackages = mkOption {
type = types.functionTo (types.listOf types.package);
- description = "Extra packages to add to the texlive scheme";
+ description = ''
+ Extra packages to add to the texlive scheme.
+ Unlike more sophisticated projects such as [latex-utils](https://github.com/jmmaloney4/latex-utils), there is no auto-discovery of necessary packages.
+ '';
default = _: [ ];
};
latexmk = {
@@ -26,6 +40,11 @@ in
rc = mkOption {
type = types.lines;
description = "contents of the .latexmkrc file";
+ default = /* perl */ ''
+ $out_dir = '.latex-build';
+ $pdf_mode = 1;
+ $pdflatex = 'lualatex -interaction=nonstopmode -file-line-error -synctex=1 %O %S';
+ '';
};
rcFile = mkOption {
type = types.path;
@@ -36,6 +55,7 @@ in
type = types.functionTo types.package;
readOnly = true;
internal = true;
+ description = "A wrapper derivation to add the rc file to latexmk";
default =
tex:
pkgs.symlinkJoin {
@@ -52,6 +72,7 @@ in
package = mkOption {
type = types.package;
readOnly = true;
+ description = "The final texlive package";
default =
let
wrapper = if config.texShell.latexmk.enable then config.texShell.latexmk._wrapper else x: x;
@@ -61,6 +82,7 @@ in
devShell = mkOption {
type = types.package;
readOnly = true;
+ description = "The final texlive shell";
default = pkgs.mkShellNoCC { buildInputs = [ config.texShell.build.package ]; };
};
};